#include <gmlib/sm2/internal/sm2p256v1.h>
#include <stdexcept>
#include <cstring>

using namespace sm2::internal;

void test_sm2_fn_sub()
{
    sm2_fn_t    a, b, c;
    std::uint8_t c_data[32];

    static std::uint8_t a0[32] = {0x56,0x19,0x0e,0x81,0x7f,0xc0,0xe0,0x65,0x53,0xbc,0xdd,0x5f,0xdc,0x7c,0xcf,0x9b,0xe0,0x73,0x63,0xc0,0xe4,0x33,0x4b,0xf1,0x19,0x2c,0xc9,0x12,0xe5,0x19,0xaf,0xfd};
    static std::uint8_t b0[32] = {0x52,0x0c,0xa5,0x4e,0x9e,0x04,0xb3,0x91,0xb8,0x0e,0xe2,0xc0,0x83,0x59,0x26,0xe2,0x40,0x34,0x93,0x80,0xa2,0x06,0xcb,0xd6,0xce,0x9d,0x6b,0x89,0x6b,0x02,0x0a,0x04};
    static std::uint8_t c0[32] = {0x04,0x0c,0x69,0x32,0xe1,0xbc,0x2c,0xd3,0x9b,0xad,0xfa,0x9f,0x59,0x23,0xa8,0xb9,0xa0,0x3e,0xd0,0x40,0x42,0x2c,0x80,0x1a,0x4a,0x8f,0x5d,0x89,0x7a,0x17,0xa5,0xf9};
    sm2_fn_from_bytes(a, a0);
    sm2_fn_from_bytes(b, b0);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c0, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a1[32] = {0xc4,0x10,0x61,0xd7,0x6e,0xcc,0x6c,0x99,0xbf,0xef,0x49,0x62,0xda,0x5b,0x65,0x30,0x1f,0x8b,0x19,0xd8,0x5b,0x86,0x06,0xd7,0x96,0x0d,0x12,0x8c,0x5d,0x0c,0x9e,0xdb};
    static std::uint8_t b1[32] = {0xc5,0x44,0xa1,0xac,0xc2,0xab,0x37,0x0f,0x88,0x84,0x80,0x87,0x5a,0xdb,0xb6,0xff,0xf1,0x3a,0x98,0x62,0x22,0x95,0x56,0x34,0xad,0x6e,0xf7,0x2f,0x79,0xa3,0x00,0x17};
    static std::uint8_t c1[32] = {0xfe,0xcb,0xc0,0x29,0xac,0x21,0x35,0x8a,0x37,0x6a,0xc8,0xdb,0x7f,0x7f,0xae,0x2f,0xa0,0x54,0x60,0xe1,0x5a,0xb6,0xb5,0xce,0x3c,0x5a,0x0f,0x66,0x1d,0x3e,0xdf,0xe7};
    sm2_fn_from_bytes(a, a1);
    sm2_fn_from_bytes(b, b1);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c1, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a2[32] = {0x57,0xa3,0x9c,0x52,0xb3,0x4b,0x83,0x26,0x20,0x6e,0xb0,0x6f,0xcd,0x0d,0x67,0x3d,0xa5,0x1c,0x61,0x24,0x94,0x1c,0x7e,0xcc,0x03,0xbe,0x9a,0xbc,0xca,0xaa,0x8e,0x4a};
    static std::uint8_t b2[32] = {0xfd,0xf1,0x1d,0xa7,0xc0,0x2d,0xbd,0xc9,0xf2,0x53,0xf6,0x8b,0x62,0x60,0x96,0xbf,0x08,0xe8,0x7c,0x3f,0xf6,0x98,0x6d,0x02,0x84,0xfd,0x9d,0x98,0xe7,0x82,0xcc,0xf2};
    static std::uint8_t c2[32] = {0x59,0xb2,0x7e,0xa9,0xf3,0x1d,0xc5,0x5c,0x2e,0x1a,0xb9,0xe4,0x6a,0xac,0xd0,0x7e,0x0e,0x37,0xc4,0x4f,0xbf,0x4a,0x16,0xf4,0xd2,0x7c,0xf1,0x2d,0x1c,0xfd,0x02,0x7b};
    sm2_fn_from_bytes(a, a2);
    sm2_fn_from_bytes(b, b2);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c2, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a3[32] = {0xe7,0xca,0x0b,0x8f,0x08,0x7e,0xaf,0x7e,0xeb,0x3c,0xd5,0x95,0xae,0xeb,0xb1,0x61,0x2d,0x4c,0x27,0xd4,0x82,0x6b,0x17,0x39,0x14,0x0b,0x41,0xda,0x2a,0x50,0x36,0x0f};
    static std::uint8_t b3[32] = {0x43,0x16,0xa7,0xe5,0x25,0x36,0x65,0x18,0x74,0x63,0x4b,0x97,0x07,0xcb,0xce,0x08,0x20,0x1e,0x47,0xed,0x40,0xfb,0x06,0x01,0x9c,0x9b,0x3c,0xa6,0x0a,0xd6,0x6e,0xa1};
    static std::uint8_t c3[32] = {0xa4,0xb3,0x63,0xa9,0xe3,0x48,0x4a,0x66,0x76,0xd9,0x89,0xfe,0xa7,0x1f,0xe3,0x59,0x0d,0x2d,0xdf,0xe7,0x41,0x70,0x11,0x37,0x77,0x70,0x05,0x34,0x1f,0x79,0xc7,0x6e};
    sm2_fn_from_bytes(a, a3);
    sm2_fn_from_bytes(b, b3);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c3, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a4[32] = {0x9c,0xea,0x57,0xc7,0xd3,0x1e,0x13,0xc9,0x86,0xa7,0x36,0xc6,0x96,0xfe,0x90,0x52,0xda,0x6d,0xb9,0x4f,0xa7,0x68,0x03,0xb3,0x2f,0xd8,0x52,0xe0,0x7d,0xa6,0xca,0x33};
    static std::uint8_t b4[32] = {0xda,0xb0,0xc1,0x43,0xd9,0x90,0xc3,0xa0,0x46,0x13,0xfe,0x4c,0x5d,0xb9,0x94,0x81,0x82,0xa4,0x4a,0x48,0x62,0x5b,0xf2,0x77,0x43,0xd6,0x1a,0x56,0x1e,0x37,0x08,0x0b};
    static std::uint8_t c4[32] = {0xc2,0x39,0x96,0x82,0xf9,0x8d,0x50,0x29,0x40,0x93,0x38,0x7a,0x39,0x44,0xfb,0xd0,0xc9,0xcd,0x4e,0x72,0x66,0xd2,0x16,0x67,0x3f,0xbe,0x2c,0x93,0x99,0x45,0x03,0x4b};
    sm2_fn_from_bytes(a, a4);
    sm2_fn_from_bytes(b, b4);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c4, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a5[32] = {0x04,0x90,0xea,0xfb,0x0d,0x51,0xe2,0x7d,0xff,0x63,0xc1,0x2c,0xa6,0xea,0x52,0x67,0x73,0x88,0xce,0xdc,0x62,0xfa,0x95,0xa4,0xc2,0xdd,0x61,0x82,0x4b,0x49,0x27,0xb2};
    static std::uint8_t b5[32] = {0x31,0x91,0x56,0x6b,0xf1,0x38,0xa9,0xb7,0x0c,0xf9,0x2b,0x88,0xc2,0x1b,0xec,0x68,0x67,0x8c,0x1e,0x43,0x87,0x75,0xec,0x73,0x74,0xd1,0xc4,0x1d,0xfd,0x8c,0x39,0x22};
    static std::uint8_t c5[32] = {0xd2,0xff,0x94,0x8e,0x1c,0x19,0x38,0xc6,0xf2,0x6a,0x95,0xa3,0xe4,0xce,0x65,0xfe,0x7e,0x00,0x90,0x03,0xfd,0x4a,0xae,0x5c,0xa1,0xc7,0x91,0x6d,0x87,0x92,0x2f,0xb3};
    sm2_fn_from_bytes(a, a5);
    sm2_fn_from_bytes(b, b5);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c5, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a6[32] = {0x3c,0x3e,0xd1,0x6f,0xb4,0x79,0x91,0xea,0xdb,0xaa,0x04,0x2a,0xb3,0x85,0xe2,0x27,0xc2,0x05,0xfe,0x4b,0x98,0xcb,0xb8,0x19,0x15,0xeb,0x4d,0x6d,0xf4,0xef,0x64,0x6b};
    static std::uint8_t b6[32] = {0x8a,0xff,0x12,0x4a,0x88,0x3c,0xd6,0x6b,0x19,0x1b,0xab,0x96,0x3b,0xc8,0x06,0xde,0x39,0xab,0xb8,0xeb,0x91,0x6a,0x47,0x28,0x99,0x09,0x3c,0x52,0xb8,0xc5,0xe4,0xc9};
    static std::uint8_t c6[32] = {0xb1,0x3f,0xbf,0x24,0x2c,0x3c,0xbb,0x7f,0xc2,0x8e,0x58,0x94,0x77,0xbd,0xdb,0x48,0xfa,0x5e,0x24,0xcb,0x29,0x27,0x76,0x1b,0xd0,0x9e,0x05,0x24,0x75,0xfe,0xc0,0xc5};
    sm2_fn_from_bytes(a, a6);
    sm2_fn_from_bytes(b, b6);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c6, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a7[32] = {0xb2,0xcb,0xe3,0xaa,0xe8,0x91,0x8a,0xd8,0x32,0x74,0xa6,0xd7,0x70,0x16,0x50,0x96,0xdb,0x68,0x13,0x50,0x90,0x9e,0xda,0xb0,0xa5,0xe8,0xfd,0x7b,0x91,0x69,0x53,0x10};
    static std::uint8_t b7[32] = {0x2c,0x92,0x47,0x8b,0xf7,0x1f,0x29,0x56,0x9c,0x5d,0xfd,0x1c,0x1f,0x09,0x84,0xf6,0x76,0xff,0xe3,0xef,0xba,0xb6,0x22,0x2c,0xb3,0x72,0x69,0x9f,0x54,0xb7,0xff,0xca};
    static std::uint8_t c7[32] = {0x86,0x39,0x9c,0x1e,0xf1,0x72,0x61,0x81,0x96,0x16,0xa9,0xbb,0x51,0x0c,0xcb,0xa0,0x64,0x68,0x2f,0x60,0xd5,0xe8,0xb8,0x83,0xf2,0x76,0x93,0xdc,0x3c,0xb1,0x53,0x46};
    sm2_fn_from_bytes(a, a7);
    sm2_fn_from_bytes(b, b7);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c7, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a8[32] = {0x90,0x1d,0x6b,0x50,0x9b,0xc0,0x39,0x5b,0x6e,0x5d,0xe0,0x77,0x39,0xec,0xb8,0x18,0x7a,0x65,0x3e,0xa2,0x2c,0x66,0x30,0xf0,0x2c,0xb8,0x44,0x03,0x92,0xcd,0x6e,0x6d};
    static std::uint8_t b8[32] = {0xe4,0xaf,0xd5,0xaf,0x0e,0x07,0x04,0xae,0x6b,0xee,0xd0,0xd3,0x4b,0xde,0xed,0xf7,0x35,0x54,0xc5,0x3b,0xe0,0x87,0xd6,0x90,0x6c,0x92,0xc6,0x04,0x0f,0xa4,0xa7,0xc5};
    static std::uint8_t c8[32] = {0xab,0x6d,0x95,0xa0,0x8d,0xb9,0x34,0xad,0x02,0x6f,0x0f,0xa3,0xee,0x0d,0xca,0x20,0xb7,0x14,0x58,0xd1,0x6d,0xa4,0x5f,0x8b,0x13,0xe1,0x72,0x08,0xbc,0xfe,0x07,0xcb};
    sm2_fn_from_bytes(a, a8);
    sm2_fn_from_bytes(b, b8);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c8, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a9[32] = {0x79,0xdb,0xc3,0x07,0x45,0x8d,0x99,0xc2,0x9a,0xf2,0x0f,0xff,0x66,0x9a,0xf4,0x41,0x6f,0x7b,0x0a,0x74,0x30,0xa6,0xcc,0xa5,0xcf,0x08,0x27,0x4e,0xf0,0x24,0x58,0x90};
    static std::uint8_t b9[32] = {0x3f,0xd6,0x80,0x7b,0x80,0x30,0xd4,0x7c,0xca,0xc9,0x2e,0x61,0x17,0x04,0x59,0x37,0x5d,0x9a,0x95,0x86,0xe0,0xcb,0x24,0xa4,0x70,0xf7,0xd0,0x97,0xf5,0xf0,0x79,0xf1};
    static std::uint8_t c9[32] = {0x3a,0x05,0x42,0x8b,0xc5,0x5c,0xc5,0x45,0xd0,0x28,0xe1,0x9e,0x4f,0x96,0x9b,0x0a,0x11,0xe0,0x74,0xed,0x4f,0xdb,0xa8,0x01,0x5e,0x10,0x56,0xb6,0xfa,0x33,0xde,0x9f};
    sm2_fn_from_bytes(a, a9);
    sm2_fn_from_bytes(b, b9);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c9, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a10[32] = {0x2b,0xdf,0xe4,0xf7,0x85,0xdd,0x63,0x99,0x46,0xa1,0xca,0xa5,0x39,0x34,0x74,0x1a,0xa6,0x02,0x81,0xf1,0x11,0xf0,0xef,0xd4,0x77,0x27,0xe1,0xa0,0xc6,0x8b,0xb1,0x75};
    static std::uint8_t b10[32] = {0xe6,0xf5,0xb7,0x1c,0x95,0x93,0x6c,0xc4,0x79,0xaa,0xf8,0x41,0x45,0x1b,0x8b,0x4a,0x0b,0x8b,0xae,0x44,0xbf,0x1c,0x41,0x80,0xd8,0x4e,0xcc,0x4f,0xfc,0xc4,0xe3,0x8b};
    static std::uint8_t c10[32] = {0x44,0xea,0x2d,0xd9,0xf0,0x49,0xf6,0xd4,0xcc,0xf6,0xd2,0x63,0xf4,0x18,0xe8,0xd0,0x0c,0x7a,0xb3,0x17,0x74,0x9a,0xb3,0x7e,0xf2,0x95,0x09,0x5a,0x03,0x9c,0x0f,0x0d};
    sm2_fn_from_bytes(a, a10);
    sm2_fn_from_bytes(b, b10);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c10, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a11[32] = {0x22,0xc6,0x1d,0x8b,0x6f,0xc7,0x05,0x93,0x56,0x9d,0x1f,0x8a,0xe1,0xa9,0x26,0x22,0xf4,0x19,0x70,0xff,0x67,0xd2,0x19,0xd6,0xab,0x73,0x10,0x25,0xeb,0x61,0x72,0x26};
    static std::uint8_t b11[32] = {0xc1,0xa6,0x5b,0x85,0xa4,0xb6,0x9f,0x1e,0x41,0x54,0xf7,0x2f,0x7f,0xb4,0xdf,0xe9,0x38,0x51,0xd2,0x01,0x36,0x91,0xb2,0x48,0x1f,0xa7,0x0e,0xfe,0x1e,0x9c,0x9b,0x8d};
    static std::uint8_t c11[32] = {0x61,0x1f,0xc2,0x04,0xcb,0x10,0x66,0x75,0x15,0x48,0x28,0x5b,0x61,0xf4,0x46,0x39,0x2d,0xcb,0x7e,0x69,0x53,0x06,0x6c,0xb9,0xdf,0x87,0xf5,0x31,0x06,0x9a,0x17,0xbc};
    sm2_fn_from_bytes(a, a11);
    sm2_fn_from_bytes(b, b11);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c11, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a12[32] = {0x50,0x91,0xf2,0xef,0xcf,0x99,0x9b,0xc2,0x5d,0x6b,0x0d,0x04,0x17,0x14,0x81,0xb7,0x16,0x44,0x4f,0x69,0x62,0x9e,0x86,0xe3,0x1e,0x42,0x70,0xa4,0xf3,0x81,0x77,0x7c};
    static std::uint8_t b12[32] = {0x69,0x3e,0xdc,0xd8,0x57,0xb1,0x9b,0x6f,0xab,0xc6,0xe2,0xfd,0x36,0x5a,0x7b,0x00,0x3c,0x27,0x1d,0xcd,0x1f,0x18,0x50,0x16,0xd0,0x40,0xd6,0x09,0x0b,0x5f,0xf4,0x3f};
    static std::uint8_t c12[32] = {0xe7,0x53,0x16,0x16,0x77,0xe8,0x00,0x52,0xb1,0xa4,0x2a,0x06,0xe0,0xba,0x06,0xb6,0x4c,0x21,0x11,0x07,0x65,0x4c,0x3b,0xf7,0xa1,0xbd,0x8e,0xa5,0x21,0xf6,0xc4,0x60};
    sm2_fn_from_bytes(a, a12);
    sm2_fn_from_bytes(b, b12);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c12, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a13[32] = {0x5a,0x1d,0x62,0xeb,0x8b,0x67,0x73,0x9c,0xe8,0xb2,0x9e,0x11,0xc6,0x79,0x5a,0x35,0xd2,0xb8,0x56,0x59,0x84,0x61,0x11,0x2f,0x4e,0xe5,0x11,0xf6,0x90,0xbe,0xc7,0xb5};
    static std::uint8_t b13[32] = {0xf1,0xe4,0xfd,0xf4,0xa0,0x9d,0xc7,0xa8,0xf4,0x00,0x8d,0x8b,0x9f,0x68,0xf9,0xe6,0x89,0x2a,0xc7,0x7c,0xb6,0x3b,0x9c,0x9f,0x7e,0xf5,0xfe,0xeb,0xf2,0xa8,0xf8,0x0d};
    static std::uint8_t c13[32] = {0x68,0x38,0x64,0xf5,0xea,0xc9,0xab,0xf3,0xf4,0xb2,0x10,0x86,0x27,0x10,0x60,0x4e,0xbb,0x91,0x6e,0x47,0xef,0xeb,0x79,0xbb,0x23,0xab,0x07,0x13,0xd7,0xeb,0x10,0xcb};
    sm2_fn_from_bytes(a, a13);
    sm2_fn_from_bytes(b, b13);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c13, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a14[32] = {0xe5,0x8d,0xca,0x5b,0x35,0x46,0x33,0x39,0x8c,0x6c,0x0e,0x87,0x5d,0xca,0x88,0xa5,0x99,0x08,0x7a,0x83,0x75,0x05,0x90,0x02,0xff,0x44,0x70,0x4f,0x9c,0x01,0x73,0x45};
    static std::uint8_t b14[32] = {0xfb,0x76,0xba,0x04,0x18,0x4f,0x0b,0x90,0xda,0x4f,0x7c,0x2f,0x9f,0x4d,0x99,0x1e,0x11,0x00,0x63,0xf6,0x42,0x22,0xc6,0xee,0x69,0x76,0x34,0x37,0x8e,0xd3,0xf3,0x99};
    static std::uint8_t c14[32] = {0xea,0x17,0x10,0x56,0x1c,0xf7,0x27,0xa8,0xb2,0x1c,0x92,0x57,0xbe,0x7c,0xef,0x86,0xfa,0x0b,0xf5,0xf8,0x54,0xa8,0xce,0x3f,0xe9,0x8a,0x30,0x21,0x47,0x02,0xc0,0xcf};
    sm2_fn_from_bytes(a, a14);
    sm2_fn_from_bytes(b, b14);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c14, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a15[32] = {0xce,0x51,0x6e,0x7d,0x6d,0xd7,0xf0,0x3c,0x53,0x56,0x8a,0xc4,0x79,0x28,0xaa,0xb0,0x7f,0xd6,0xaa,0xb6,0x47,0x3f,0x33,0x32,0xdc,0xba,0xe8,0x5f,0x6b,0xeb,0x47,0xfc};
    static std::uint8_t b15[32] = {0xc5,0x0c,0x36,0x7f,0xba,0xe8,0x26,0x81,0xc9,0x3f,0x9a,0xc9,0x6b,0x71,0x97,0x50,0x2a,0xf9,0x50,0x5e,0x07,0x19,0x85,0x05,0x73,0x20,0x86,0x42,0x64,0xd9,0x3e,0xe5};
    static std::uint8_t c15[32] = {0x09,0x45,0x37,0xfd,0xb2,0xef,0xc9,0xba,0x8a,0x16,0xef,0xfb,0x0d,0xb7,0x13,0x60,0x54,0xdd,0x5a,0x58,0x40,0x25,0xae,0x2d,0x69,0x9a,0x62,0x1d,0x07,0x12,0x09,0x17};
    sm2_fn_from_bytes(a, a15);
    sm2_fn_from_bytes(b, b15);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c15, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a16[32] = {0x47,0xf0,0xdf,0x77,0x61,0xe0,0xd9,0xb5,0x55,0xea,0x76,0x00,0x96,0x02,0x1a,0x33,0x7b,0x12,0x35,0x3e,0x49,0xbe,0xac,0xb1,0x2c,0x07,0x69,0x17,0x03,0x11,0x99,0xfc};
    static std::uint8_t b16[32] = {0x87,0xd5,0x31,0xba,0x18,0xa8,0x45,0x8b,0x17,0x46,0xbe,0xf4,0xae,0x56,0x43,0x8a,0x65,0x78,0xa0,0x27,0xe1,0x82,0xfe,0x57,0x07,0x10,0xaa,0x28,0xa8,0xdc,0x94,0xd3};
    static std::uint8_t c16[32] = {0xc0,0x1b,0xad,0xbc,0x49,0x38,0x94,0x2a,0x3e,0xa3,0xb7,0x0b,0xe7,0xab,0xd6,0xa8,0x87,0x9d,0x74,0x81,0x8a,0x01,0xb3,0x85,0x78,0xb2,0xb2,0xf7,0x94,0x0a,0x46,0x4c};
    sm2_fn_from_bytes(a, a16);
    sm2_fn_from_bytes(b, b16);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c16, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a17[32] = {0xb9,0xcf,0x63,0x61,0xbf,0x98,0x87,0x6c,0xcb,0x14,0x25,0x2b,0x80,0xdc,0x12,0xc0,0x6d,0xd3,0xc7,0xb4,0xf3,0x23,0x55,0xd6,0xdf,0xef,0xb9,0x52,0x65,0x20,0x95,0xef};
    static std::uint8_t b17[32] = {0x87,0x88,0x0c,0xf1,0x36,0xc0,0xc5,0x07,0x8b,0xa7,0x08,0xb3,0x1a,0xe3,0xfe,0xa7,0x9f,0xc8,0x74,0x00,0xa9,0x4e,0x5c,0x80,0x51,0x12,0xc4,0x97,0xb4,0x1e,0xe0,0xa0};
    static std::uint8_t c17[32] = {0x32,0x47,0x56,0x70,0x88,0xd7,0xc2,0x65,0x3f,0x6d,0x1c,0x78,0x65,0xf8,0x14,0x18,0xce,0x0b,0x53,0xb4,0x49,0xd4,0xf9,0x56,0x8e,0xdc,0xf4,0xba,0xb1,0x01,0xb5,0x4f};
    sm2_fn_from_bytes(a, a17);
    sm2_fn_from_bytes(b, b17);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c17, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a18[32] = {0x3a,0x09,0x4d,0xa2,0x02,0x4e,0x28,0x9f,0xd2,0x34,0x6d,0x63,0x1e,0x74,0x47,0xe3,0x46,0x9e,0xe4,0x05,0xf2,0x91,0xeb,0x65,0x52,0xee,0x7d,0x97,0x45,0x50,0x0f,0x3c};
    static std::uint8_t b18[32] = {0x78,0xc8,0xa3,0x74,0x4b,0x46,0xf8,0x5b,0xc1,0xc8,0x49,0x27,0x1b,0xee,0xce,0x68,0x8f,0x92,0x62,0xc3,0xaa,0xa6,0x68,0x52,0x36,0x37,0x18,0xf7,0x75,0x5b,0xb1,0xc9};
    static std::uint8_t c18[32] = {0xc1,0x40,0xaa,0x2c,0xb7,0x07,0x30,0x44,0x10,0x6c,0x24,0x3c,0x02,0x85,0x79,0x7a,0x29,0x10,0x60,0xad,0x69,0xb1,0x88,0x3e,0x70,0x73,0x58,0xa9,0x09,0xc9,0x9e,0x96};
    sm2_fn_from_bytes(a, a18);
    sm2_fn_from_bytes(b, b18);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c18, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a19[32] = {0xa4,0x4b,0xf7,0x56,0x4d,0x85,0xa2,0xbf,0xb6,0x1a,0x28,0xa4,0x67,0x71,0xa4,0x5e,0xf4,0xa2,0x67,0x50,0x30,0x6e,0xf2,0x94,0x07,0x32,0x75,0x14,0x06,0x06,0x56,0x90};
    static std::uint8_t b19[32] = {0x58,0xc9,0x2f,0xdb,0xab,0x64,0x9c,0x62,0xfb,0x69,0x4f,0x82,0x94,0x99,0xa5,0x3a,0x0c,0x6e,0x8e,0xa5,0xdb,0xe0,0x71,0x02,0x5c,0xd4,0x1b,0x52,0x2b,0xe0,0x9a,0x62};
    static std::uint8_t c19[32] = {0x4b,0x82,0xc7,0x7a,0xa2,0x21,0x06,0x5c,0xba,0xb0,0xd9,0x21,0xd2,0xd7,0xff,0x24,0xe8,0x33,0xd8,0xaa,0x54,0x8e,0x81,0x91,0xaa,0x5e,0x59,0xc1,0xda,0x25,0xbc,0x2e};
    sm2_fn_from_bytes(a, a19);
    sm2_fn_from_bytes(b, b19);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c19, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a20[32] = {0x77,0x61,0x9f,0x6e,0x92,0xdd,0xf5,0x89,0x07,0x70,0xd8,0xe9,0x3e,0xde,0x1f,0xf6,0x53,0x78,0x7a,0x08,0x80,0xd8,0xbc,0x31,0xb8,0xd8,0xad,0xfc,0xc8,0xbc,0xd1,0xaf};
    static std::uint8_t b20[32] = {0xc2,0xce,0xe1,0xf5,0x1d,0xf4,0x30,0xec,0x93,0xaf,0x86,0xba,0x14,0xe9,0x7a,0xd7,0xb5,0x39,0x94,0x09,0xb8,0xc5,0x5e,0x3b,0xb2,0xac,0xfd,0xd2,0x89,0xcb,0xee,0xc1};
    static std::uint8_t c20[32] = {0xb4,0x92,0xbd,0x78,0x74,0xe9,0xc4,0x9c,0x73,0xc1,0x52,0x2f,0x29,0xf4,0xa5,0x1e,0x10,0x42,0xc5,0x69,0xe9,0xd9,0x63,0x21,0x59,0xe7,0xa4,0x33,0x78,0xc6,0x24,0x11};
    sm2_fn_from_bytes(a, a20);
    sm2_fn_from_bytes(b, b20);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c20, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a21[32] = {0xe9,0x8b,0xbf,0x20,0xa8,0x21,0xb9,0x20,0x32,0x99,0x0b,0x29,0x6b,0xcb,0xca,0xde,0x27,0x86,0xe1,0xa2,0x73,0xad,0xe2,0xbb,0xb4,0x25,0xcd,0x37,0x33,0xb1,0xc2,0xda};
    static std::uint8_t b21[32] = {0xee,0xab,0xe1,0x18,0x2a,0x71,0x5a,0x76,0x52,0xf5,0x89,0xb6,0xde,0x0d,0xd7,0xf4,0x0a,0xbc,0x6b,0x6c,0x91,0x03,0x61,0x7d,0xd0,0xc3,0x69,0x2c,0x6c,0x6c,0xd8,0x3f};
    static std::uint8_t c21[32] = {0xfa,0xdf,0xde,0x07,0x7d,0xb0,0x5e,0xa9,0xdf,0xa3,0x81,0x72,0x8d,0xbd,0xf2,0xe9,0x8e,0xce,0x55,0xa1,0x04,0x70,0x86,0x69,0x37,0x1e,0x58,0x14,0x01,0x1a,0x2b,0xbe};
    sm2_fn_from_bytes(a, a21);
    sm2_fn_from_bytes(b, b21);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c21, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a22[32] = {0xc3,0x3a,0x52,0x5d,0xdf,0x08,0x0a,0x0b,0x59,0x1a,0x33,0x8d,0xb0,0x3c,0x9a,0x73,0xf0,0x1b,0x70,0x24,0x8a,0xfe,0x85,0x96,0xfe,0xd0,0x05,0xe4,0x77,0x28,0x8b,0x4c};
    static std::uint8_t b22[32] = {0xcb,0x10,0xf5,0xfe,0x3a,0x0f,0xd6,0x1c,0x23,0xeb,0x23,0xce,0xd2,0x29,0xed,0x45,0xf7,0xa5,0xb2,0x0f,0xa6,0x5e,0xd6,0x37,0x68,0x22,0x08,0x90,0xa8,0x00,0x20,0x14};
    static std::uint8_t c22[32] = {0xf8,0x29,0x5c,0x5e,0xa4,0xf8,0x33,0xef,0x35,0x2f,0x0f,0xbe,0xde,0x12,0xad,0x2d,0x6a,0x79,0x9d,0x80,0x06,0x65,0xb4,0x8a,0xea,0x69,0xf1,0x5d,0x08,0xfd,0xac,0x5b};
    sm2_fn_from_bytes(a, a22);
    sm2_fn_from_bytes(b, b22);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c22, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a23[32] = {0x0f,0x39,0xd2,0x3e,0x3c,0x94,0x2f,0xdf,0xc9,0x22,0xa3,0x34,0x18,0xb9,0xe2,0x33,0xc7,0x14,0x94,0x0f,0xb3,0xa3,0xe7,0x08,0x56,0x8d,0x9b,0x4c,0x6b,0x3b,0xdf,0x67};
    static std::uint8_t b23[32] = {0x9d,0xba,0x01,0xb1,0x56,0x60,0xdd,0xeb,0x7d,0xde,0x46,0xc8,0x35,0xb9,0x1c,0x72,0xbe,0xd3,0x07,0xe2,0x14,0x6a,0xa2,0x4e,0xe3,0x65,0xf8,0x99,0xfb,0x49,0x69,0x9d};
    static std::uint8_t c23[32] = {0x71,0x7f,0xd0,0x8b,0xe6,0x33,0x51,0xf4,0x4b,0x44,0x5c,0x6b,0xe3,0x00,0xc5,0xc0,0x7a,0x45,0x6b,0x98,0xc0,0xff,0x49,0xe4,0xc6,0xe3,0x96,0xbb,0xa9,0xc7,0xb6,0xed};
    sm2_fn_from_bytes(a, a23);
    sm2_fn_from_bytes(b, b23);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c23, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a24[32] = {0xe7,0xd8,0x73,0x9a,0x48,0xb2,0xbe,0x15,0x91,0x24,0x33,0xc7,0x30,0xd9,0xa1,0x73,0x80,0xe6,0xe0,0x05,0x82,0xf7,0xb6,0x2f,0x01,0xf8,0x3e,0xc3,0x16,0x27,0x65,0x94};
    static std::uint8_t b24[32] = {0x7e,0xc7,0x10,0xd3,0xad,0x75,0x95,0x30,0x90,0x1a,0x13,0xee,0xc4,0x45,0x8b,0x46,0x6a,0x9e,0xc6,0x6f,0xb3,0x3f,0x99,0x92,0x62,0x39,0x56,0x35,0xe2,0x47,0xc5,0x7f};
    static std::uint8_t c24[32] = {0x69,0x11,0x62,0xc6,0x9b,0x3d,0x28,0xe5,0x01,0x0a,0x1f,0xd8,0x6c,0x94,0x16,0x2d,0x16,0x48,0x19,0x95,0xcf,0xb8,0x1c,0x9c,0x9f,0xbe,0xe8,0x8d,0x33,0xdf,0xa0,0x15};
    sm2_fn_from_bytes(a, a24);
    sm2_fn_from_bytes(b, b24);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c24, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a25[32] = {0xd1,0x5d,0x5c,0x72,0x10,0xc1,0xd8,0x4f,0xc9,0x5e,0xbf,0xeb,0xdf,0x8e,0x77,0xe9,0xdd,0x93,0x55,0x08,0x2b,0xe1,0x1f,0xbb,0x0b,0xdd,0xa4,0x60,0xd7,0xe2,0x82,0x34};
    static std::uint8_t b25[32] = {0xad,0xac,0x68,0x94,0x27,0x76,0x4c,0x03,0x71,0xeb,0xb3,0xd4,0xa6,0x37,0xe7,0xd7,0x25,0x81,0x52,0x78,0xf6,0x58,0x8f,0x1c,0x99,0xc6,0x99,0xc2,0xe6,0x0e,0x6d,0x35};
    static std::uint8_t c25[32] = {0x23,0xb0,0xf3,0xdd,0xe9,0x4b,0x8c,0x4c,0x57,0x73,0x0c,0x17,0x39,0x56,0x90,0x12,0xb8,0x12,0x02,0x8f,0x35,0x88,0x90,0x9e,0x72,0x17,0x0a,0x9d,0xf1,0xd4,0x14,0xff};
    sm2_fn_from_bytes(a, a25);
    sm2_fn_from_bytes(b, b25);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c25, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a26[32] = {0x23,0xea,0x83,0xb3,0xe3,0x16,0xe0,0x02,0x31,0x39,0x8c,0x75,0xff,0xc0,0x09,0x3d,0x5e,0x14,0x31,0xcf,0x8c,0x39,0x38,0x93,0x3e,0x94,0x3a,0x84,0xc2,0xbf,0x51,0x35};
    static std::uint8_t b26[32] = {0xf1,0x35,0xe6,0xe3,0x06,0xd0,0x33,0x7a,0x82,0x8c,0x01,0x7a,0xa7,0xee,0x66,0x54,0x9e,0x27,0x3b,0xad,0x69,0xa4,0xab,0x50,0x41,0xb6,0xa0,0x97,0x9f,0xdb,0x32,0x54};
    static std::uint8_t c26[32] = {0x32,0xb4,0x9c,0xcf,0xdc,0x46,0xac,0x87,0xae,0xad,0x8a,0xfb,0x57,0xd1,0xa2,0xe8,0x31,0xf0,0xd5,0x8d,0x44,0x5a,0x92,0x6e,0x50,0x99,0x8d,0xf6,0x5c,0xb9,0x60,0x04};
    sm2_fn_from_bytes(a, a26);
    sm2_fn_from_bytes(b, b26);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c26, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a27[32] = {0x3e,0xcf,0x83,0xd0,0xf4,0x83,0xe6,0x04,0x3a,0x8d,0x6a,0x5b,0x60,0xf4,0xc2,0xd8,0x66,0x1b,0x2d,0xf1,0xdb,0x50,0x9a,0x82,0x0a,0x99,0x1d,0xa3,0xad,0xa5,0xe1,0xbd};
    static std::uint8_t b27[32] = {0xf9,0xca,0xfb,0x72,0xfc,0x21,0xd0,0x42,0x5b,0xfa,0xa9,0x0c,0xec,0xe4,0x26,0x63,0xd5,0x0e,0x7b,0x56,0x43,0xeb,0x49,0xbd,0xc7,0x1a,0xb1,0xd1,0x42,0xc6,0x00,0x44};
    static std::uint8_t c27[32] = {0x45,0x04,0x88,0x5c,0xf8,0x62,0x15,0xc1,0xde,0x92,0xc1,0x4e,0x74,0x10,0x9c,0x74,0x03,0x10,0x92,0x06,0xb9,0x2b,0x55,0xef,0x97,0x3a,0x5f,0xdb,0xa4,0xb5,0x22,0x9c};
    sm2_fn_from_bytes(a, a27);
    sm2_fn_from_bytes(b, b27);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c27, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a28[32] = {0x4a,0x17,0xcc,0xc9,0x40,0xab,0xac,0x57,0x69,0xc7,0x83,0x83,0x3f,0x3c,0x41,0xe4,0x81,0xb6,0xdf,0xd5,0xf7,0xa3,0x92,0x18,0xd6,0xca,0x56,0x52,0x54,0x34,0xb3,0xf2};
    static std::uint8_t b28[32] = {0x3c,0xbf,0x14,0x85,0x2c,0x3d,0xb3,0xbb,0xf8,0x11,0x60,0x27,0x42,0x00,0x60,0x5d,0xbc,0xa9,0xd3,0x57,0x61,0xfc,0x93,0x8f,0x5e,0xee,0x7c,0x78,0x6a,0x27,0x66,0xea};
    static std::uint8_t c28[32] = {0x0d,0x58,0xb8,0x44,0x14,0x6d,0xf8,0x9b,0x71,0xb6,0x23,0x5b,0xfd,0x3b,0xe1,0x86,0xc5,0x0d,0x0c,0x7e,0x95,0xa6,0xfe,0x89,0x77,0xdb,0xd9,0xd9,0xea,0x0d,0x4d,0x08};
    sm2_fn_from_bytes(a, a28);
    sm2_fn_from_bytes(b, b28);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c28, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a29[32] = {0xbb,0xcd,0x6f,0xfe,0xf6,0x06,0xe6,0x69,0x1a,0x7d,0x33,0x47,0x22,0x65,0x54,0x60,0x6c,0x62,0x16,0x7f,0x1b,0x88,0x7c,0x17,0xf9,0x14,0x4b,0xb9,0x5d,0x53,0x81,0xcf};
    static std::uint8_t b29[32] = {0xb1,0xd8,0x37,0x04,0xa5,0x7a,0x0b,0x8e,0x11,0x11,0x31,0xf1,0x9e,0x27,0x0a,0x3e,0x55,0x4b,0xb6,0x14,0x46,0x4b,0xbe,0xfa,0x8e,0x46,0x27,0x16,0x44,0x52,0xf2,0xff};
    static std::uint8_t c29[32] = {0x09,0xf5,0x38,0xfa,0x50,0x8c,0xda,0xdb,0x09,0x6c,0x01,0x55,0x84,0x3e,0x4a,0x22,0x17,0x16,0x60,0x6a,0xd5,0x3c,0xbd,0x1d,0x6a,0xce,0x24,0xa3,0x19,0x00,0x8e,0xd0};
    sm2_fn_from_bytes(a, a29);
    sm2_fn_from_bytes(b, b29);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c29, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a30[32] = {0x4f,0xaf,0x49,0x86,0x89,0x03,0x9e,0x95,0x11,0x48,0x1f,0x73,0xaf,0x94,0x4b,0xce,0x32,0x04,0xde,0xf7,0xca,0x99,0x74,0x70,0x6c,0x1d,0x8b,0xc5,0xd0,0x83,0xd9,0x94};
    static std::uint8_t b30[32] = {0x5f,0x25,0x60,0x42,0x3e,0xb5,0x88,0xf5,0x03,0x46,0xc0,0x56,0x61,0x6c,0xd7,0x79,0x13,0x9c,0xf9,0x2e,0xde,0x34,0xf6,0xf4,0xf4,0x37,0xcd,0x55,0x10,0x40,0xe8,0xdc};
    static std::uint8_t c30[32] = {0xf0,0x89,0xe9,0x43,0x4a,0x4e,0x15,0xa0,0x0e,0x01,0x5f,0x1d,0x4e,0x27,0x74,0x54,0x90,0x6b,0xc5,0x34,0x0e,0x2a,0x82,0xa6,0xcb,0xa1,0xb2,0x79,0xfa,0x18,0x31,0xdb};
    sm2_fn_from_bytes(a, a30);
    sm2_fn_from_bytes(b, b30);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c30, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a31[32] = {0x28,0xb0,0xa4,0x09,0x04,0xe8,0x18,0x61,0x39,0xe9,0x23,0x82,0x3a,0x7b,0x80,0x62,0xaf,0x31,0x45,0xc2,0xeb,0x08,0x60,0xd0,0xb5,0x4e,0x49,0xaf,0x9f,0xcd,0x19,0x16};
    static std::uint8_t b31[32] = {0x15,0x33,0xdb,0x97,0x57,0x1c,0x0f,0x79,0xb6,0x1a,0x77,0x2c,0x41,0xbf,0x63,0x90,0xa8,0x73,0x19,0xab,0x5c,0x96,0xd4,0x1d,0x57,0x2d,0x95,0xdb,0x2e,0x9b,0x5b,0x9e};
    static std::uint8_t c31[32] = {0x13,0x7c,0xc8,0x71,0xad,0xcc,0x08,0xe7,0x83,0xce,0xac,0x55,0xf8,0xbc,0x1c,0xd2,0x06,0xbe,0x2c,0x17,0x8e,0x71,0x8c,0xb3,0x5e,0x20,0xb3,0xd4,0x71,0x31,0xbd,0x78};
    sm2_fn_from_bytes(a, a31);
    sm2_fn_from_bytes(b, b31);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c31, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a32[32] = {0xfb,0x39,0xa3,0x4f,0x6e,0xc6,0x5d,0x2a,0xfa,0x8f,0xd2,0x5b,0xd0,0x7e,0xde,0x0f,0xb8,0xb0,0xef,0x87,0x91,0x39,0x41,0x3e,0x9d,0x48,0xd4,0x0e,0xa0,0xb8,0x00,0xae};
    static std::uint8_t b32[32] = {0x43,0xf9,0xe8,0xa5,0x7d,0xd5,0xa5,0x19,0x6d,0x8c,0xb3,0x0e,0xc6,0xff,0xa0,0x54,0xff,0x46,0xf6,0xe9,0x5f,0xc7,0x0e,0xaa,0xe4,0xc6,0x37,0x09,0x43,0x1d,0x75,0x6d};
    static std::uint8_t c32[32] = {0xb7,0x3f,0xba,0xa9,0xf0,0xf0,0xb8,0x11,0x8d,0x03,0x1f,0x4d,0x09,0x7f,0x3d,0xba,0xb9,0x69,0xf8,0x9e,0x31,0x72,0x32,0x93,0xb8,0x82,0x9d,0x05,0x5d,0x9a,0x8b,0x41};
    sm2_fn_from_bytes(a, a32);
    sm2_fn_from_bytes(b, b32);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c32, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a33[32] = {0x3d,0x8f,0x3a,0x90,0x61,0x14,0x67,0xbe,0xeb,0x5e,0x28,0x13,0xee,0x9e,0xdb,0x8d,0x58,0x60,0x15,0x36,0x14,0x93,0xff,0x8e,0x92,0x72,0x91,0xdb,0x73,0xc0,0x9f,0xb0};
    static std::uint8_t b33[32] = {0x50,0xa1,0x6c,0x24,0x66,0xf2,0xed,0x8d,0x80,0xd8,0xa9,0x4f,0xfb,0x15,0xa7,0x75,0xdf,0x2f,0x60,0x52,0xf3,0xf1,0x7c,0xa6,0xaf,0xb5,0xbc,0x65,0x38,0xdc,0xc0,0x54};
    static std::uint8_t c33[32] = {0xec,0xed,0xce,0x6a,0xfa,0x21,0x7a,0x31,0x6a,0x85,0x7e,0xc3,0xf3,0x89,0x34,0x16,0xeb,0x34,0x94,0x4e,0x42,0x68,0x88,0x13,0x36,0x78,0xc9,0x7f,0x74,0xb9,0x20,0x7f};
    sm2_fn_from_bytes(a, a33);
    sm2_fn_from_bytes(b, b33);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c33, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a34[32] = {0xe2,0x17,0xa5,0xd8,0x2a,0x3c,0x44,0x06,0x16,0xbd,0xe0,0xaf,0xec,0x5e,0x1b,0xb7,0xf7,0x27,0xff,0xe9,0x64,0x94,0x19,0xf5,0xe1,0x3c,0x55,0x28,0x80,0x31,0xed,0xdc};
    static std::uint8_t b34[32] = {0xac,0xd0,0x84,0x73,0x99,0xee,0x0c,0xb5,0x7d,0x65,0xa8,0xa1,0x01,0xd3,0xb3,0x7d,0x3d,0xab,0x6e,0x68,0x41,0xa5,0xb2,0x1f,0xfa,0x1b,0x5c,0x48,0x53,0x26,0xb8,0x36};
    static std::uint8_t c34[32] = {0x35,0x47,0x21,0x64,0x90,0x4e,0x37,0x50,0x99,0x58,0x38,0x0e,0xea,0x8a,0x68,0x3a,0xb9,0x7c,0x91,0x81,0x22,0xee,0x67,0xd5,0xe7,0x20,0xf8,0xe0,0x2d,0x0b,0x35,0xa6};
    sm2_fn_from_bytes(a, a34);
    sm2_fn_from_bytes(b, b34);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c34, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a35[32] = {0x71,0xb8,0xdb,0x07,0xfe,0x09,0x79,0x47,0x4d,0xd0,0xba,0x24,0x3e,0x2b,0x14,0x2a,0xaf,0x23,0xb4,0x18,0xf8,0x38,0x08,0x8a,0xb3,0x5b,0x4e,0x11,0x60,0x57,0x0a,0x64};
    static std::uint8_t b35[32] = {0xb7,0x7b,0x3d,0xe2,0xce,0xb0,0x1b,0x3a,0x26,0xfc,0xbd,0xbb,0x33,0x59,0x38,0xd9,0xa7,0x54,0x26,0x31,0xfa,0x65,0xd4,0x72,0x22,0x26,0xd5,0x30,0xfb,0xdb,0x18,0x79};
    static std::uint8_t c35[32] = {0xba,0x3d,0x9d,0x24,0x2f,0x59,0x5e,0x0d,0x26,0xd3,0xfc,0x69,0x0a,0xd1,0xdb,0x50,0x79,0xd3,0x6d,0x52,0x1f,0x98,0x39,0x43,0xe4,0xf0,0x6c,0xe9,0x9e,0x51,0x33,0x0e};
    sm2_fn_from_bytes(a, a35);
    sm2_fn_from_bytes(b, b35);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c35, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a36[32] = {0x3a,0x57,0x9b,0x6c,0xe9,0x6a,0x4e,0x43,0x42,0x69,0xa7,0x92,0x27,0x75,0x0e,0x1c,0xdb,0x80,0xfa,0x14,0x75,0x40,0x29,0x7f,0x85,0x16,0x2e,0x26,0x63,0xc1,0x14,0xe4};
    static std::uint8_t b36[32] = {0x23,0x95,0xfe,0x7d,0x0a,0x89,0xf0,0x10,0x3b,0x4a,0x2f,0x01,0x12,0xf3,0x2e,0x19,0xc0,0x61,0x79,0x3f,0xea,0x64,0xd2,0xb6,0xb3,0x0d,0x32,0x89,0x64,0xd1,0x6e,0x31};
    static std::uint8_t c36[32] = {0x16,0xc1,0x9c,0xef,0xde,0xe0,0x5e,0x33,0x07,0x1f,0x78,0x91,0x14,0x81,0xe0,0x03,0x1b,0x1f,0x80,0xd4,0x8a,0xdb,0x56,0xc8,0xd2,0x08,0xfb,0x9c,0xfe,0xef,0xa6,0xb3};
    sm2_fn_from_bytes(a, a36);
    sm2_fn_from_bytes(b, b36);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c36, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a37[32] = {0x13,0xa3,0xa4,0x86,0xe7,0x9e,0x3c,0x8d,0xdc,0x8f,0x26,0x5c,0x56,0xbc,0x2e,0x2b,0xbc,0xd8,0x0d,0xd6,0x12,0x96,0x3f,0x2a,0xd7,0x22,0xd8,0xd4,0x99,0xbf,0x18,0x8f};
    static std::uint8_t b37[32] = {0x53,0x1a,0xc6,0x74,0x96,0xd6,0x4c,0x94,0xce,0xb6,0x3b,0x2c,0x37,0x60,0x97,0xc1,0x42,0xbd,0xa2,0xb1,0xc5,0x8c,0xea,0x25,0x01,0x12,0xd1,0x67,0xf9,0xf4,0x85,0x7e};
    static std::uint8_t c37[32] = {0xc0,0x88,0xde,0x11,0x50,0xc7,0xef,0xf9,0x0d,0xd8,0xeb,0x30,0x1f,0x5b,0x96,0x69,0xec,0x1e,0x4a,0x8f,0x6e,0xcf,0x5a,0x31,0x29,0xcb,0xfb,0x75,0xd9,0x9f,0xd4,0x34};
    sm2_fn_from_bytes(a, a37);
    sm2_fn_from_bytes(b, b37);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c37, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a38[32] = {0xac,0xc1,0x22,0xf4,0x64,0xc3,0x98,0xeb,0x65,0xd4,0x9b,0xbd,0xbf,0x2a,0x3c,0xef,0x53,0x59,0xf3,0x3a,0xd8,0x3a,0x2a,0xed,0x3b,0x2a,0xb4,0x39,0x31,0x39,0xf2,0x9d};
    static std::uint8_t b38[32] = {0x32,0x8a,0xb8,0x34,0xf6,0xdd,0x88,0xd4,0x25,0x9d,0x2d,0x25,0xda,0x09,0x0e,0x67,0x86,0xec,0x88,0xe5,0x23,0x99,0x80,0xfd,0xe3,0x33,0x50,0x39,0x7c,0xb4,0x41,0x6e};
    static std::uint8_t c38[32] = {0x7a,0x36,0x6a,0xbf,0x6d,0xe6,0x10,0x17,0x40,0x37,0x6e,0x97,0xe5,0x21,0x2e,0x87,0xcc,0x6d,0x6a,0x55,0xb4,0xa0,0xa9,0xef,0x57,0xf7,0x63,0xff,0xb4,0x85,0xb1,0x2f};
    sm2_fn_from_bytes(a, a38);
    sm2_fn_from_bytes(b, b38);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c38, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a39[32] = {0x6f,0xc9,0x2a,0x0f,0xb8,0x58,0xf3,0x81,0x10,0xed,0x67,0x17,0xa0,0x6a,0xc9,0xfe,0xe1,0x13,0x64,0xf4,0x6f,0xbb,0xde,0x46,0x39,0xc3,0xde,0x13,0x94,0xaa,0x19,0x91};
    static std::uint8_t b39[32] = {0x38,0xf7,0x6a,0xfd,0x4b,0x83,0x80,0x83,0xee,0x17,0x22,0x33,0x2a,0x4a,0xb6,0x84,0x30,0x6c,0x77,0xd9,0x24,0x18,0x66,0x7d,0x8c,0xf4,0x05,0xbb,0x97,0x71,0x8e,0x8c};
    static std::uint8_t c39[32] = {0x36,0xd1,0xbf,0x12,0x6c,0xd5,0x72,0xfd,0x22,0xd6,0x44,0xe4,0x76,0x20,0x13,0x7a,0xb0,0xa6,0xed,0x1b,0x4b,0xa3,0x77,0xc8,0xac,0xcf,0xd8,0x57,0xfd,0x38,0x8b,0x05};
    sm2_fn_from_bytes(a, a39);
    sm2_fn_from_bytes(b, b39);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c39, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a40[32] = {0xc8,0xf0,0xc4,0x3f,0x1d,0x8a,0xf1,0x3d,0xb5,0x0d,0x45,0x82,0x9c,0x11,0x7c,0x87,0x00,0xbe,0xe3,0x6f,0xea,0x8a,0x68,0x73,0x98,0x99,0x45,0x6a,0x28,0x74,0x45,0xe9};
    static std::uint8_t b40[32] = {0x59,0x85,0x0e,0x36,0xdd,0x95,0x27,0x73,0xf2,0x5e,0xf9,0x74,0x0e,0xde,0xa9,0x52,0x5d,0xce,0xe5,0x7d,0x0c,0x15,0xa2,0x0f,0x6b,0x44,0x95,0xce,0xc3,0x86,0x61,0xcf};
    static std::uint8_t c40[32] = {0x6f,0x6b,0xb6,0x08,0x3f,0xf5,0xc9,0xc9,0xc2,0xae,0x4c,0x0e,0x8d,0x32,0xd3,0x34,0xa2,0xef,0xfd,0xf2,0xde,0x74,0xc6,0x64,0x2d,0x54,0xaf,0x9b,0x64,0xed,0xe4,0x1a};
    sm2_fn_from_bytes(a, a40);
    sm2_fn_from_bytes(b, b40);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c40, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a41[32] = {0x06,0x96,0xfc,0x12,0xb9,0xe9,0x86,0x57,0xd0,0x68,0x71,0xf4,0xca,0xd0,0xb6,0xa7,0xc0,0xf5,0x1c,0x70,0xf1,0x6f,0x16,0x45,0x26,0x59,0x90,0x66,0xd7,0x24,0x91,0x6f};
    static std::uint8_t b41[32] = {0x93,0x4d,0xc5,0x2b,0x9c,0x83,0xbc,0x9f,0x38,0xe5,0xda,0xaa,0x05,0x2a,0xa8,0x96,0x0c,0xa4,0x2c,0xe4,0x1d,0x53,0x26,0xa3,0xe0,0x58,0xbd,0xf1,0xcb,0xa5,0x68,0xe9};
    static std::uint8_t c41[32] = {0x73,0x49,0x36,0xe6,0x1d,0x65,0xc9,0xb8,0x97,0x82,0x97,0x4a,0xc5,0xa6,0x0e,0x11,0x26,0x54,0xce,0xf7,0xf5,0xe1,0xf4,0xcc,0x99,0xbc,0xc6,0x7e,0x45,0x54,0x69,0xa9};
    sm2_fn_from_bytes(a, a41);
    sm2_fn_from_bytes(b, b41);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c41, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a42[32] = {0x59,0xa0,0xb4,0x3a,0xdd,0xfa,0x54,0x3b,0x09,0xa8,0x6f,0x5a,0x52,0x84,0x3e,0x6c,0x1d,0x0f,0xd5,0xd5,0x2a,0x90,0x30,0x9f,0x20,0xc9,0xc2,0x40,0x70,0x4c,0xe1,0x5c};
    static std::uint8_t b42[32] = {0xe7,0x97,0x54,0x54,0xfc,0x02,0x5c,0x74,0x9f,0x19,0xa6,0x5e,0x14,0x5a,0x77,0xe2,0x41,0xa9,0xb2,0x1a,0xf9,0x40,0x8f,0x37,0x72,0xd9,0x95,0xa9,0xbd,0xfe,0x9c,0x5a};
    static std::uint8_t c42[32] = {0x72,0x09,0x5f,0xe4,0xe1,0xf7,0xf7,0xc6,0x6a,0x8e,0xc8,0xfc,0x3e,0x29,0xc6,0x89,0x4d,0x6a,0x03,0x25,0x53,0x15,0xa6,0x93,0x01,0xac,0x20,0x9f,0xec,0x23,0x86,0x25};
    sm2_fn_from_bytes(a, a42);
    sm2_fn_from_bytes(b, b42);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c42, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a43[32] = {0xd1,0x61,0x96,0x66,0xdf,0xf1,0x3b,0xae,0x73,0x69,0x4f,0x45,0x7d,0xcf,0xec,0xaa,0x1f,0xde,0x54,0xcf,0x49,0x1e,0x97,0xc9,0x8b,0x85,0x24,0x26,0x2f,0x7f,0x58,0x2b};
    static std::uint8_t b43[32] = {0x4a,0x46,0x0a,0xdc,0xe1,0x1c,0x23,0x79,0x20,0xe5,0x5e,0x02,0x46,0xeb,0xbe,0xdb,0x62,0xc3,0x37,0xbf,0xb9,0xdd,0x94,0xac,0x7f,0x01,0x91,0xcd,0xf8,0x9e,0x6f,0x0e};
    static std::uint8_t c43[32] = {0x87,0x1b,0x8b,0x89,0xfe,0xd5,0x18,0x35,0x52,0x83,0xf1,0x43,0x36,0xe4,0x2d,0xce,0xbd,0x1b,0x1d,0x0f,0x8f,0x41,0x03,0x1d,0x0c,0x83,0x92,0x58,0x36,0xe0,0xe9,0x1d};
    sm2_fn_from_bytes(a, a43);
    sm2_fn_from_bytes(b, b43);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c43, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a44[32] = {0x4a,0xd6,0x7e,0x91,0xf5,0x26,0x9c,0x50,0x60,0x24,0x55,0xdf,0x6e,0x56,0xf2,0x05,0xdb,0x12,0x1e,0x80,0xa0,0xc3,0xcc,0x27,0x18,0x21,0xe6,0x48,0xa2,0x01,0x84,0x7b};
    static std::uint8_t b44[32] = {0x31,0x6a,0xa4,0xd1,0x24,0x9f,0x58,0x10,0x62,0x85,0x96,0x79,0x29,0x79,0xf4,0xbc,0xd9,0xb1,0xf1,0xe1,0x2d,0xb7,0xee,0x0d,0xf8,0x23,0x2e,0x98,0x6e,0xa8,0x25,0x3a};
    static std::uint8_t c44[32] = {0x19,0x6b,0xd9,0xc0,0xd0,0x87,0x44,0x3f,0xfd,0x9e,0xbf,0x66,0x44,0xdc,0xfd,0x49,0x01,0x60,0x2c,0x9f,0x73,0x0b,0xde,0x19,0x1f,0xfe,0xb7,0xb0,0x33,0x59,0x5f,0x41};
    sm2_fn_from_bytes(a, a44);
    sm2_fn_from_bytes(b, b44);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c44, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a45[32] = {0xb3,0x0d,0xe3,0x37,0x9a,0xd2,0x51,0x8b,0x86,0x77,0x13,0xea,0x62,0x6b,0xdd,0x9b,0xb4,0xc2,0xf7,0x1a,0x2f,0xe9,0xbe,0x37,0x8c,0xf7,0xb0,0x6e,0x4f,0xcc,0x79,0x9a};
    static std::uint8_t b45[32] = {0xdf,0xe0,0xeb,0xf3,0x4c,0xdd,0x67,0xa5,0x96,0xfd,0x3d,0x12,0xc7,0x23,0xaa,0xac,0x32,0x3e,0x83,0xef,0x8e,0xc8,0xfe,0x69,0xc4,0x64,0xf0,0x9a,0xba,0x6f,0xe7,0xbc};
    static std::uint8_t c45[32] = {0xd3,0x2c,0xf7,0x43,0x4d,0xf4,0xe9,0xe5,0xef,0x79,0xd6,0xd7,0x9b,0x48,0x32,0xee,0xf4,0x88,0x52,0x95,0xc2,0xe6,0xc4,0xf9,0x1c,0x4e,0xb3,0xdc,0xcf,0x31,0xd3,0x01};
    sm2_fn_from_bytes(a, a45);
    sm2_fn_from_bytes(b, b45);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c45, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a46[32] = {0x52,0x37,0x37,0xd7,0xb2,0x49,0x44,0xcd,0xe8,0x82,0x21,0x3a,0xd5,0x68,0x9f,0x74,0xda,0x77,0xc3,0x31,0xc9,0x89,0x10,0xcb,0xa8,0x85,0xa5,0x74,0x89,0x12,0x2f,0x42};
    static std::uint8_t b46[32] = {0xf6,0x03,0xc7,0xd6,0xe7,0xeb,0xbc,0x28,0x2c,0x9a,0x9a,0xe6,0x50,0x58,0x49,0xdc,0xa3,0x46,0xa8,0xb0,0x0e,0x43,0xd4,0x8c,0xd9,0x90,0xf2,0x84,0xb9,0x03,0x3c,0x6c};
    static std::uint8_t c46[32] = {0x5c,0x33,0x6f,0xff,0xca,0x5d,0x88,0xa5,0xbb,0xe7,0x86,0x54,0x85,0x10,0x55,0x97,0xa9,0x34,0xf9,0xec,0xdd,0x0b,0x41,0x6a,0x22,0xb0,0xa6,0xf9,0x09,0xe4,0x33,0xf9};
    sm2_fn_from_bytes(a, a46);
    sm2_fn_from_bytes(b, b46);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c46, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a47[32] = {0x2b,0xf9,0xa7,0xc3,0x0e,0xcd,0xb5,0xea,0x2d,0x04,0x1a,0x6c,0xf5,0x0e,0x44,0x9d,0x42,0xa4,0xb2,0x73,0x37,0x43,0x5c,0x48,0x58,0xa2,0x8c,0x0a,0x42,0xe6,0x76,0xbc};
    static std::uint8_t b47[32] = {0x04,0x0c,0xe4,0xa1,0x7d,0xb3,0x01,0xc8,0xa9,0x6f,0x80,0xe3,0x8c,0x86,0xa3,0xfa,0xea,0x2f,0x4e,0x6e,0xa5,0x0b,0x87,0xdc,0x24,0xf1,0xbb,0x78,0x0c,0xa2,0x0b,0xab};
    static std::uint8_t c47[32] = {0x27,0xec,0xc3,0x21,0x91,0x1a,0xb4,0x21,0x83,0x94,0x99,0x89,0x68,0x87,0xa0,0xa2,0x58,0x75,0x64,0x04,0x92,0x37,0xd4,0x6c,0x33,0xb0,0xd0,0x92,0x36,0x44,0x6b,0x11};
    sm2_fn_from_bytes(a, a47);
    sm2_fn_from_bytes(b, b47);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c47, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a48[32] = {0xcf,0x10,0x8a,0x21,0xf6,0x02,0xd1,0x20,0x56,0xb1,0x12,0xfd,0xf5,0xf1,0x31,0xaf,0xc3,0xb5,0xbe,0x16,0x78,0xd4,0x4b,0x29,0x63,0x01,0x1d,0xb3,0x68,0x00,0x44,0x96};
    static std::uint8_t b48[32] = {0x1f,0xd4,0x6b,0xd8,0x9f,0xc6,0xf5,0xdd,0xcc,0x8a,0x7e,0xde,0xf1,0x73,0xec,0xdf,0xad,0x8c,0xdc,0xf1,0xd7,0x6d,0x0c,0x46,0x03,0x7d,0x53,0x5b,0x36,0x83,0x69,0xcb};
    static std::uint8_t c48[32] = {0xaf,0x3c,0x1e,0x49,0x56,0x3b,0xdb,0x42,0x8a,0x26,0x94,0x1f,0x04,0x7d,0x44,0xd0,0x16,0x28,0xe1,0x24,0xa1,0x67,0x3e,0xe3,0x5f,0x83,0xca,0x58,0x31,0x7c,0xda,0xcb};
    sm2_fn_from_bytes(a, a48);
    sm2_fn_from_bytes(b, b48);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c48, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a49[32] = {0x07,0x07,0xe0,0xde,0x82,0x50,0xeb,0x1d,0x77,0xf5,0xa7,0xd5,0xda,0xff,0x52,0x10,0x8b,0x58,0x6b,0x62,0xc4,0x61,0xf0,0x04,0x9f,0x5f,0x53,0x69,0xaf,0x43,0x2e,0x2e};
    static std::uint8_t b49[32] = {0x8a,0x7e,0xa4,0x3c,0xc1,0xd8,0x7b,0xf1,0xac,0xda,0x28,0x0b,0x00,0x76,0x7a,0xb6,0x5d,0x69,0x1b,0x69,0x81,0x56,0x28,0x16,0xf8,0xf0,0xc0,0xa9,0xd7,0xba,0xf5,0x32};
    static std::uint8_t c49[32] = {0x7c,0x89,0x3c,0xa0,0xc0,0x78,0x6f,0x2b,0xcb,0x1b,0x7f,0xca,0xda,0x88,0xd7,0x59,0x9f,0xf3,0x2f,0x64,0x64,0xd1,0xcd,0x18,0xfa,0x2a,0x86,0xc9,0x11,0x5d,0x7a,0x1f};
    sm2_fn_from_bytes(a, a49);
    sm2_fn_from_bytes(b, b49);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c49, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a50[32] = {0xa0,0x6a,0x5d,0x93,0xfb,0x86,0x86,0xda,0x70,0x82,0x3a,0xc8,0x24,0xf4,0x19,0x64,0xce,0x53,0x02,0x4f,0x98,0xfc,0x7c,0x9f,0xa2,0x07,0x25,0x4a,0x8b,0xce,0x82,0x89};
    static std::uint8_t b50[32] = {0x06,0x95,0x65,0x03,0xcd,0xa9,0xfe,0xf9,0xd8,0x70,0x51,0x20,0x6b,0x51,0x11,0x55,0xf2,0xd7,0x09,0xc7,0xdb,0xd8,0x85,0xb5,0x67,0x31,0x17,0xde,0xc1,0x32,0x79,0x33};
    static std::uint8_t c50[32] = {0x99,0xd4,0xf8,0x90,0x2d,0xdc,0x87,0xe0,0x98,0x11,0xe9,0xa7,0xb9,0xa3,0x08,0x0e,0xdb,0x7b,0xf8,0x87,0xbd,0x23,0xf6,0xea,0x3a,0xd6,0x0d,0x6b,0xca,0x9c,0x09,0x56};
    sm2_fn_from_bytes(a, a50);
    sm2_fn_from_bytes(b, b50);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c50, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a51[32] = {0xaf,0x44,0x38,0xbf,0xa5,0x23,0xd3,0x6a,0xff,0xd7,0xec,0x0f,0x16,0xd6,0x30,0x9f,0xfa,0xa2,0xbc,0xfb,0x21,0x8e,0x07,0x90,0x91,0x2e,0x5e,0x53,0x85,0x9a,0x94,0x1d};
    static std::uint8_t b51[32] = {0xc1,0x94,0x2c,0x76,0x37,0xe2,0x5f,0x83,0xfb,0x5b,0xd0,0x26,0x3d,0xa7,0xcd,0xe3,0xcf,0x07,0xe2,0xfc,0x06,0x3b,0x81,0x01,0xa2,0xc7,0x6d,0x51,0xf9,0x71,0x0f,0x94};
    static std::uint8_t c51[32] = {0xed,0xb0,0x0c,0x48,0x6d,0x41,0x73,0xe7,0x04,0x7c,0x1b,0xe8,0xd9,0x2e,0x62,0xbb,0x9d,0x9e,0xb9,0x6a,0x3d,0x18,0x8b,0xba,0x42,0x22,0xe5,0x0a,0xc5,0xfe,0xc5,0xac};
    sm2_fn_from_bytes(a, a51);
    sm2_fn_from_bytes(b, b51);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c51, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a52[32] = {0x80,0x06,0xe0,0x14,0xed,0x74,0xc3,0x56,0x7d,0x7e,0x83,0xa8,0x0a,0x4e,0xd4,0x24,0x90,0x72,0x4b,0xfd,0xcc,0x4f,0x8e,0x89,0x33,0x32,0xb8,0xdb,0x24,0x11,0x87,0xaf};
    static std::uint8_t b52[32] = {0x96,0x65,0x86,0x99,0x95,0xf8,0xd1,0xbe,0x61,0x29,0x7c,0xd6,0xba,0xad,0xf0,0x30,0x98,0x49,0xdf,0x1c,0x2a,0xce,0x34,0x83,0x8c,0x58,0xbf,0x7e,0x78,0x5a,0xf5,0x68};
    static std::uint8_t c52[32] = {0xe9,0xa1,0x59,0x7a,0x57,0x7b,0xf1,0x98,0x1c,0x55,0x06,0xd1,0x4f,0xa0,0xe3,0xf3,0x6a,0x2c,0x4c,0x4c,0xc3,0x47,0x5f,0x30,0xfa,0x95,0xed,0x65,0xe5,0x8b,0xd3,0x6a};
    sm2_fn_from_bytes(a, a52);
    sm2_fn_from_bytes(b, b52);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c52, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a53[32] = {0xac,0x8e,0x07,0x41,0xec,0xd6,0xfd,0xff,0x72,0xa3,0xf1,0xc6,0x81,0x36,0x9e,0xb0,0x5f,0x52,0x6e,0x12,0xba,0x50,0xb0,0x04,0xe8,0xec,0x20,0xa6,0x7b,0x78,0xb6,0x5e};
    static std::uint8_t b53[32] = {0xf3,0x6c,0x0d,0xa3,0x12,0x03,0x22,0x3a,0x49,0x21,0xc3,0x0e,0xc6,0x69,0x87,0x5b,0x40,0x02,0xee,0xc4,0x47,0x19,0x5f,0x2c,0x46,0x37,0x65,0x63,0xab,0x40,0x85,0xf4};
    static std::uint8_t c53[32] = {0xb9,0x21,0xf9,0x9d,0xda,0xd3,0xdb,0xc5,0x29,0x82,0x2e,0xb7,0xba,0xcd,0x17,0x54,0x91,0x53,0x5e,0xb9,0x94,0xfd,0x56,0x03,0xf6,0x70,0xaf,0x4c,0x0a,0x0d,0x71,0x8d};
    sm2_fn_from_bytes(a, a53);
    sm2_fn_from_bytes(b, b53);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c53, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a54[32] = {0x5b,0x4a,0x94,0xa7,0x53,0x8a,0x88,0x4a,0x56,0x81,0x4e,0x15,0x48,0x8f,0x2d,0x38,0xdf,0x19,0x39,0xd4,0xc5,0x40,0x01,0xd8,0xac,0x7d,0x4f,0x12,0x55,0xd0,0x00,0xc8};
    static std::uint8_t b54[32] = {0x0c,0x88,0x4a,0xc6,0x89,0x03,0x33,0x72,0xd2,0xe7,0xf6,0x43,0x0a,0x46,0x0e,0xaf,0xd9,0x75,0x99,0x86,0xea,0x7b,0xa1,0x11,0x73,0x54,0xad,0xd5,0x0d,0x46,0x90,0xac};
    static std::uint8_t c54[32] = {0x4e,0xc2,0x49,0xe0,0xca,0x87,0x54,0xd7,0x83,0x99,0x57,0xd2,0x3e,0x49,0x1e,0x89,0x05,0xa3,0xa0,0x4d,0xda,0xc4,0x60,0xc7,0x39,0x28,0xa1,0x3d,0x48,0x89,0x70,0x1c};
    sm2_fn_from_bytes(a, a54);
    sm2_fn_from_bytes(b, b54);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c54, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a55[32] = {0x9e,0xdd,0x34,0x13,0x07,0x32,0xf1,0x7f,0x54,0x28,0x5c,0x6c,0x27,0xfe,0x16,0x1a,0x92,0xc9,0x6f,0x05,0xab,0xad,0x0c,0x41,0xb1,0xaf,0x7f,0x60,0x58,0x85,0x91,0x0b};
    static std::uint8_t b55[32] = {0xf7,0xe8,0xbc,0x1c,0x69,0x8c,0xc6,0x3f,0xe5,0x57,0xdb,0xe6,0x14,0xbd,0x03,0x0e,0xca,0xd9,0x49,0xd9,0xd8,0x4a,0x5c,0xf1,0x9a,0x4e,0x9d,0xa0,0xfe,0x53,0x6d,0x40};
    static std::uint8_t c55[32] = {0xa6,0xf4,0x77,0xf5,0x9d,0xa6,0x2b,0x3f,0x6e,0xd0,0x80,0x86,0x13,0x41,0x13,0x0b,0x39,0xf4,0x04,0x96,0xf5,0x28,0xb4,0x7b,0x6b,0x1c,0xd5,0xc8,0x94,0x07,0x64,0xee};
    sm2_fn_from_bytes(a, a55);
    sm2_fn_from_bytes(b, b55);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c55, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a56[32] = {0x92,0xf8,0x23,0x3d,0x88,0x7d,0x22,0xae,0xa1,0xe3,0xce,0xc4,0x82,0x0e,0x55,0x74,0x62,0xc5,0x2b,0xd5,0xf3,0x3b,0x63,0xfb,0x6f,0x09,0x11,0xac,0xeb,0xb1,0x0e,0xd4};
    static std::uint8_t b56[32] = {0x37,0xc3,0x8a,0xbf,0xf5,0xaf,0x8a,0xd6,0x2d,0x6d,0x8e,0xb8,0xfd,0x14,0x80,0xf7,0x71,0x2f,0xcf,0xac,0x96,0x20,0xb1,0x59,0x99,0xb8,0xf2,0x02,0x4e,0x64,0xee,0x64};
    static std::uint8_t c56[32] = {0x5b,0x34,0x98,0x7d,0x92,0xcd,0x97,0xd8,0x74,0x76,0x40,0x0b,0x84,0xf9,0xd4,0x7c,0xf1,0x95,0x5c,0x29,0x5d,0x1a,0xb2,0xa1,0xd5,0x50,0x1f,0xaa,0x9d,0x4c,0x20,0x70};
    sm2_fn_from_bytes(a, a56);
    sm2_fn_from_bytes(b, b56);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c56, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a57[32] = {0x4e,0x1b,0x74,0xb4,0x39,0xef,0x41,0xf0,0x4f,0xe1,0x0a,0xc1,0x91,0x94,0x9d,0x59,0xb9,0x09,0x51,0x51,0x49,0x58,0xb5,0xe1,0x46,0x9a,0x5f,0x34,0x66,0x68,0xdc,0x58};
    static std::uint8_t b57[32] = {0x0a,0xa0,0x78,0xb7,0x29,0xf1,0xb1,0xe1,0x45,0x8b,0x6f,0xf0,0x25,0x7f,0xf0,0xf9,0x07,0x01,0xbd,0xf8,0xe1,0x34,0x3b,0x20,0xfd,0xe9,0xf7,0x90,0x26,0x09,0x3e,0xe3};
    static std::uint8_t c57[32] = {0x43,0x7a,0xfb,0xfd,0x0f,0xfd,0x90,0x0f,0x0a,0x55,0x9a,0xd1,0x6c,0x14,0xac,0x60,0xb2,0x07,0x93,0x58,0x68,0x24,0x7a,0xc0,0x48,0xb0,0x67,0xa4,0x40,0x5f,0x9d,0x75};
    sm2_fn_from_bytes(a, a57);
    sm2_fn_from_bytes(b, b57);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c57, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a58[32] = {0x3e,0x2b,0x3d,0x2b,0x5c,0x14,0x79,0xa4,0x6c,0x69,0x01,0x61,0xc5,0xcc,0x75,0xfd,0x9a,0x25,0x6e,0x52,0x7d,0x0c,0x2b,0x90,0xbc,0x04,0xfd,0x77,0xcb,0x5e,0x91,0x4b};
    static std::uint8_t b58[32] = {0x1d,0x70,0x98,0xc5,0xaa,0x42,0xd0,0x52,0x38,0xe8,0xfe,0xa7,0x3d,0xc2,0xb2,0xd7,0x5d,0x92,0xb2,0x22,0x6b,0xf3,0xa4,0x87,0xd8,0xda,0x5a,0x7e,0xe2,0x97,0xa9,0xab};
    static std::uint8_t c58[32] = {0x20,0xba,0xa4,0x65,0xb1,0xd1,0xa9,0x52,0x33,0x80,0x02,0xba,0x88,0x09,0xc3,0x26,0x3c,0x92,0xbc,0x30,0x11,0x18,0x87,0x08,0xe3,0x2a,0xa2,0xf8,0xe8,0xc6,0xe7,0xa0};
    sm2_fn_from_bytes(a, a58);
    sm2_fn_from_bytes(b, b58);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c58, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a59[32] = {0x5f,0x49,0x9c,0x36,0x3d,0x41,0x9d,0xf9,0x04,0xc8,0x55,0xf2,0x04,0xac,0xaf,0x1e,0xf0,0x12,0x57,0x6a,0xa9,0x40,0xa0,0x39,0x2d,0x6f,0x02,0x96,0xcf,0x91,0xb6,0x6a};
    static std::uint8_t b59[32] = {0x18,0x7c,0x8c,0x2e,0xb1,0x75,0xfc,0x55,0xcb,0xfc,0xbe,0x14,0x62,0x69,0xc6,0xff,0x06,0x9a,0x10,0xf9,0xe5,0x14,0x38,0xfb,0x12,0x6d,0x1a,0x38,0x00,0x6e,0x06,0x8a};
    static std::uint8_t c59[32] = {0x46,0xcd,0x10,0x07,0x8b,0xcb,0xa1,0xa3,0x38,0xcb,0x97,0xdd,0xa2,0x42,0xe8,0x1f,0xe9,0x78,0x46,0x70,0xc4,0x2c,0x67,0x3e,0x1b,0x01,0xe8,0x5e,0xcf,0x23,0xaf,0xe0};
    sm2_fn_from_bytes(a, a59);
    sm2_fn_from_bytes(b, b59);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c59, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a60[32] = {0xc2,0x57,0x4f,0x78,0x62,0x05,0xe9,0x16,0x9d,0x8d,0xce,0x45,0x4f,0x29,0x42,0x28,0x0f,0x83,0x3b,0xa1,0x90,0x0c,0x7e,0x85,0x44,0x10,0x40,0x3f,0xe4,0xe0,0x37,0xb1};
    static std::uint8_t b60[32] = {0xe0,0x7e,0x48,0x3f,0x51,0x1a,0x73,0x46,0x07,0x25,0xfa,0xab,0x83,0x64,0xf0,0x7d,0x2d,0x0c,0xca,0xeb,0xb6,0x97,0x7e,0x75,0x4e,0x3d,0xd0,0xa9,0x2d,0x6a,0x6d,0x6f};
    static std::uint8_t c60[32] = {0xe1,0xd9,0x07,0x38,0x10,0xeb,0x75,0xd0,0x96,0x67,0xd3,0x99,0xcb,0xc4,0x51,0xaa,0x54,0x7a,0x50,0x20,0xfb,0x3b,0x05,0x3b,0x49,0x8e,0x63,0x9f,0xf1,0x4b,0x0b,0x65};
    sm2_fn_from_bytes(a, a60);
    sm2_fn_from_bytes(b, b60);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c60, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a61[32] = {0xdd,0xdf,0xa9,0x93,0xbd,0xc4,0xec,0xf4,0x0e,0x24,0x5f,0x94,0x16,0xf8,0x6b,0xa4,0xb9,0x29,0x86,0x9e,0x56,0x38,0x45,0xd1,0xec,0x42,0xdc,0x31,0xd0,0x5e,0x8f,0xdc};
    static std::uint8_t b61[32] = {0xce,0xec,0x1d,0xfc,0x8d,0xdc,0xb9,0x89,0x8a,0xd7,0x82,0xfa,0xfb,0xd1,0x44,0x1a,0xb2,0xb7,0x66,0xd5,0xe1,0x31,0x48,0x30,0xa9,0xb2,0xc3,0x56,0x66,0xff,0xed,0xe1};
    static std::uint8_t c61[32] = {0x0e,0xf3,0x8b,0x97,0x2f,0xe8,0x33,0x6a,0x83,0x4c,0xdc,0x99,0x1b,0x27,0x27,0x8a,0x06,0x72,0x1f,0xc8,0x75,0x06,0xfd,0xa1,0x42,0x90,0x18,0xdb,0x69,0x5e,0xa1,0xfb};
    sm2_fn_from_bytes(a, a61);
    sm2_fn_from_bytes(b, b61);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c61, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a62[32] = {0x08,0xa6,0x64,0x83,0xe7,0x12,0x02,0xc0,0x7f,0x0f,0x2b,0xcb,0x91,0x19,0x96,0xd8,0x61,0x9a,0xba,0x85,0x38,0xc0,0x0b,0x38,0x1a,0x76,0x18,0x58,0x8d,0x1d,0x22,0xc9};
    static std::uint8_t b62[32] = {0x6d,0x40,0x3d,0xe5,0xb5,0x42,0xad,0x2e,0xfd,0x64,0x3c,0x17,0xf9,0xc8,0x6c,0x0f,0x6d,0x0d,0xc0,0x09,0xbb,0x20,0x74,0xda,0x5f,0x48,0x49,0x7e,0x54,0xff,0x0b,0x59};
    static std::uint8_t c62[32] = {0x9b,0x66,0x26,0x9d,0x31,0xcf,0x55,0x91,0x81,0xaa,0xef,0xb3,0x97,0x51,0x2a,0xc8,0x66,0x90,0xd9,0xe6,0x9f,0x65,0x9b,0x89,0x0e,0xe9,0xc2,0xe3,0x71,0xf3,0x58,0x93};
    sm2_fn_from_bytes(a, a62);
    sm2_fn_from_bytes(b, b62);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c62, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a63[32] = {0x95,0x65,0xff,0x30,0xb2,0xe2,0x57,0xde,0xd9,0x92,0xef,0xc9,0xed,0x56,0x66,0xd7,0x02,0x66,0x75,0x1a,0x3e,0x7a,0xe0,0xc2,0x54,0xcf,0x9b,0xad,0xc0,0x35,0xa4,0x44};
    static std::uint8_t b63[32] = {0x87,0x44,0x63,0xf6,0x1e,0xbd,0x22,0x79,0xc8,0x9b,0xed,0x20,0xaf,0x50,0x71,0x3b,0x43,0x28,0x51,0x3a,0xd6,0x78,0xda,0x51,0x3a,0x18,0xb6,0x61,0xf9,0x29,0xde,0xaf};
    static std::uint8_t c63[32] = {0x0e,0x21,0x9b,0x3a,0x94,0x25,0x35,0x65,0x10,0xf7,0x02,0xa9,0x3e,0x05,0xf5,0x9b,0xbf,0x3e,0x23,0xdf,0x68,0x02,0x06,0x71,0x1a,0xb6,0xe5,0x4b,0xc7,0x0b,0xc5,0x95};
    sm2_fn_from_bytes(a, a63);
    sm2_fn_from_bytes(b, b63);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c63, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a64[32] = {0x70,0xbd,0x69,0xa4,0x0d,0x67,0xff,0x05,0x52,0xb0,0x7b,0x13,0x16,0xc1,0x81,0xe6,0x31,0x27,0x95,0x49,0xe5,0xd4,0xf0,0x61,0xb3,0x90,0x39,0xc1,0x13,0xef,0x1c,0x08};
    static std::uint8_t b64[32] = {0xea,0x4a,0x9a,0x6c,0xfe,0xee,0xb5,0x73,0x74,0x34,0xaf,0x60,0x6b,0x46,0xe9,0xa0,0x6c,0xab,0x18,0xe2,0x6d,0x42,0xcc,0x09,0x6c,0x50,0x8d,0x38,0x4b,0x66,0xfd,0x54};
    static std::uint8_t c64[32] = {0x86,0x72,0xcf,0x36,0x0e,0x79,0x49,0x91,0xde,0x7b,0xcb,0xb2,0xab,0x7a,0x98,0x45,0x36,0x80,0x5b,0xd2,0x9a,0x58,0x29,0x83,0x9a,0xfb,0xa0,0x92,0x02,0x5d,0x5f,0xd7};
    sm2_fn_from_bytes(a, a64);
    sm2_fn_from_bytes(b, b64);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c64, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a65[32] = {0x73,0x67,0x25,0xc4,0x36,0x5c,0x8a,0xa3,0xc7,0xc5,0x3e,0xf7,0x2c,0x99,0x71,0x87,0x4d,0x4b,0x1f,0x1a,0x31,0x19,0x52,0x6f,0x44,0xa0,0xc2,0x8b,0xe5,0x54,0x38,0x91};
    static std::uint8_t b65[32] = {0x44,0x54,0x87,0x85,0x26,0x8c,0x41,0xd3,0x24,0x0c,0xc1,0x18,0x18,0xc2,0xb4,0xb4,0x73,0x79,0x6e,0x47,0x87,0x52,0x91,0x27,0xe4,0x17,0xa1,0x47,0x81,0x0e,0x39,0x47};
    static std::uint8_t c65[32] = {0x2f,0x12,0x9e,0x3f,0x0f,0xd0,0x48,0xd0,0xa3,0xb8,0x7d,0xdf,0x13,0xd6,0xbc,0xd2,0xd9,0xd1,0xb0,0xd2,0xa9,0xc6,0xc1,0x47,0x60,0x89,0x21,0x44,0x64,0x45,0xff,0x4a};
    sm2_fn_from_bytes(a, a65);
    sm2_fn_from_bytes(b, b65);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c65, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a66[32] = {0x41,0xba,0x8a,0x00,0x7b,0x06,0x60,0x8d,0x9f,0x40,0x2d,0x85,0x89,0x01,0x6a,0x89,0xdf,0x27,0x29,0x53,0xfd,0xd2,0xd2,0xe9,0xdf,0x8b,0xe6,0xc2,0x0d,0xb0,0xcd,0x84};
    static std::uint8_t b66[32] = {0xe0,0xff,0x58,0x1a,0x58,0x79,0xf3,0xdf,0x5b,0x76,0xc8,0x93,0xa7,0x50,0x3d,0x61,0x96,0x68,0x72,0x5a,0x4c,0x86,0xc5,0x02,0x15,0xfd,0x9e,0xb1,0x08,0xb7,0x9d,0x1f};
    static std::uint8_t c66[32] = {0x60,0xbb,0x31,0xe5,0x22,0x8c,0x6c,0xae,0x43,0xc9,0x64,0xf1,0xe1,0xb1,0x2d,0x27,0xba,0xc2,0x96,0x64,0xd3,0x12,0x13,0x13,0x1d,0x4a,0x3c,0x1a,0x3e,0xce,0x71,0x88};
    sm2_fn_from_bytes(a, a66);
    sm2_fn_from_bytes(b, b66);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c66, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a67[32] = {0x06,0xca,0x63,0xb9,0x61,0x36,0x97,0xa4,0x63,0x28,0xfe,0x16,0x85,0x0f,0xf4,0xa9,0x3b,0x7e,0x5f,0x42,0x31,0x25,0x30,0xcb,0x4c,0x82,0x90,0x6b,0xb3,0x16,0xc8,0xfd};
    static std::uint8_t b67[32] = {0x74,0x64,0x52,0x5b,0x00,0x4e,0x32,0x25,0xf5,0xd5,0x3b,0x34,0x01,0x6a,0xdd,0x41,0xa2,0x9e,0x6a,0x59,0xb2,0xd3,0x46,0x06,0x42,0xef,0x89,0x56,0x5c,0x00,0x20,0x35};
    static std::uint8_t c67[32] = {0x92,0x66,0x11,0x5d,0x60,0xe8,0x65,0x7e,0x6d,0x53,0xc2,0xe2,0x83,0xa5,0x17,0x67,0x0a,0xe3,0xd4,0x53,0xa0,0x17,0xef,0xf0,0x5d,0x4e,0xfb,0x1e,0x90,0xeb,0xe9,0xeb};
    sm2_fn_from_bytes(a, a67);
    sm2_fn_from_bytes(b, b67);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c67, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a68[32] = {0x4c,0x89,0x3c,0xfc,0xa6,0x18,0xbe,0x4f,0x3d,0x41,0xd2,0x30,0x3a,0x75,0xb3,0x0a,0x1c,0x95,0x96,0xc8,0x0a,0x0a,0xa5,0x05,0x91,0xcb,0x50,0x80,0xec,0x32,0x77,0x6f};
    static std::uint8_t b68[32] = {0x3a,0x4a,0x4f,0xdb,0x19,0x5f,0x6a,0xee,0x8d,0x5a,0x45,0x1b,0x76,0xc1,0x54,0xba,0x87,0x46,0x29,0x49,0x0e,0x2d,0x35,0xd2,0x26,0xe1,0x40,0xa4,0x06,0x95,0xd5,0xe0};
    static std::uint8_t c68[32] = {0x12,0x3e,0xed,0x21,0x8c,0xb9,0x53,0x60,0xaf,0xe7,0x8d,0x14,0xc3,0xb4,0x5e,0x4f,0x95,0x4f,0x6d,0x7e,0xfb,0xdd,0x6f,0x33,0x6a,0xea,0x0f,0xdc,0xe5,0x9c,0xa1,0x8f};
    sm2_fn_from_bytes(a, a68);
    sm2_fn_from_bytes(b, b68);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c68, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a69[32] = {0x56,0x7a,0x73,0xbb,0x72,0xfb,0x58,0x38,0xa0,0xa2,0x27,0xba,0xf9,0x96,0x4e,0x5f,0xa7,0x75,0xc7,0x84,0x53,0xa2,0xea,0x9f,0xd7,0x8e,0xfe,0xf7,0x3d,0x77,0x0e,0xcc};
    static std::uint8_t b69[32] = {0xf5,0x06,0x0c,0xfc,0xa0,0x26,0x66,0xb6,0x05,0xc4,0x32,0xbb,0x92,0x37,0x3b,0x31,0x0e,0x21,0x4d,0xd1,0xe5,0x5e,0x88,0x6f,0x2a,0x0a,0x35,0x92,0xb0,0x61,0xff,0xca};
    static std::uint8_t c69[32] = {0x61,0x74,0x66,0xbd,0xd2,0xd4,0xf1,0x82,0x9a,0xdd,0xf4,0xff,0x67,0x5f,0x13,0x2e,0x0b,0x58,0x59,0x1d,0x90,0x0a,0x67,0x5c,0x01,0x40,0xbd,0x6d,0xc6,0xea,0x50,0x25};
    sm2_fn_from_bytes(a, a69);
    sm2_fn_from_bytes(b, b69);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c69, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a70[32] = {0x28,0x35,0x7c,0x0d,0x84,0x86,0x7c,0xf3,0x5c,0x1d,0xc0,0xa1,0x1c,0xd0,0x4a,0x3a,0x9a,0xe6,0xaf,0x66,0xb3,0xcd,0x0e,0xa3,0x96,0x2d,0xb5,0xbd,0x45,0xe1,0x01,0x45};
    static std::uint8_t b70[32] = {0xa2,0xbf,0x92,0xa4,0xcc,0xa3,0xee,0x77,0xfe,0xe1,0xdc,0x4b,0xc3,0x3e,0x29,0x04,0x2f,0xae,0x89,0xc2,0xaa,0x21,0xf3,0xcb,0x2c,0x5d,0x6d,0xa6,0x82,0x15,0x60,0xa9};
    static std::uint8_t c70[32] = {0x85,0x75,0xe9,0x67,0xb7,0xe2,0x8e,0x7b,0x5d,0x3b,0xe4,0x55,0x59,0x92,0x21,0x35,0xdd,0x3c,0x05,0x0f,0x2b,0x71,0x20,0x03,0xbd,0x8c,0x3c,0x1f,0xfd,0xa0,0xe1,0xbf};
    sm2_fn_from_bytes(a, a70);
    sm2_fn_from_bytes(b, b70);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c70, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a71[32] = {0x84,0xdd,0xe2,0xe1,0x20,0x17,0x29,0xe7,0xcc,0x89,0x5e,0x49,0xbe,0x29,0x30,0xc2,0x46,0x77,0x6c,0xdf,0xad,0x0c,0x96,0x82,0x3a,0xd8,0x53,0xfd,0x71,0x73,0x83,0x15};
    static std::uint8_t b71[32] = {0xc9,0xed,0xd9,0x80,0x7a,0xb3,0xfa,0xc7,0x5f,0xa3,0x79,0xb5,0x36,0x49,0x43,0xcc,0x72,0xb9,0x15,0x15,0xef,0x1c,0x46,0x57,0xe8,0xe9,0x5e,0x81,0x8e,0xc5,0xa3,0xf7};
    static std::uint8_t c71[32] = {0xba,0xf0,0x09,0x5f,0xa5,0x63,0x2f,0x20,0x6c,0xe5,0xe4,0x94,0x87,0xdf,0xec,0xf5,0x45,0xc2,0x37,0x34,0xdf,0xb6,0x55,0x55,0xa5,0xaa,0xe9,0x85,0x1c,0x83,0x20,0x41};
    sm2_fn_from_bytes(a, a71);
    sm2_fn_from_bytes(b, b71);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c71, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a72[32] = {0xc2,0x52,0x32,0x1b,0xaa,0x70,0x89,0x66,0x5d,0x48,0xbd,0xac,0xbf,0xc2,0x00,0x34,0x24,0x17,0x28,0xfc,0x27,0xb0,0x87,0x3b,0x30,0x80,0x3c,0xfd,0x8b,0x3c,0x2f,0xf4};
    static std::uint8_t b72[32] = {0xac,0xbc,0x11,0xbc,0x71,0xe3,0xa2,0x0e,0xee,0x89,0xec,0xa3,0xc1,0x67,0xa5,0x22,0xe6,0x0b,0xe9,0xe8,0xa8,0x28,0x39,0xaf,0x2c,0x38,0xfa,0x15,0x51,0x9a,0xe5,0xa4};
    static std::uint8_t c72[32] = {0x15,0x96,0x20,0x5f,0x38,0x8c,0xe7,0x57,0x6e,0xbe,0xd1,0x08,0xfe,0x5a,0x5b,0x11,0x3e,0x0b,0x3f,0x13,0x7f,0x88,0x4d,0x8c,0x04,0x47,0x42,0xe8,0x39,0xa1,0x4a,0x50};
    sm2_fn_from_bytes(a, a72);
    sm2_fn_from_bytes(b, b72);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c72, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a73[32] = {0x9b,0x01,0x1f,0x93,0xcf,0x23,0x7d,0xe4,0x18,0x4f,0xb3,0x4d,0x45,0x69,0x05,0x56,0xe6,0x91,0x19,0x35,0xad,0xff,0x4b,0x6b,0x24,0x70,0xe6,0x4f,0xae,0xbe,0xed,0xab};
    static std::uint8_t b73[32] = {0xc3,0xc8,0x59,0x8a,0xaa,0xd6,0x2b,0xcd,0x02,0xe9,0x9f,0x20,0x35,0x95,0xae,0x69,0x25,0x93,0x02,0x26,0x50,0x67,0xa9,0xe5,0xf8,0x1a,0x20,0xb4,0x26,0x5a,0x46,0x0f};
    static std::uint8_t c73[32] = {0xd7,0x38,0xc6,0x08,0x24,0x4d,0x52,0x17,0x15,0x66,0x14,0x2d,0x0f,0xd3,0x56,0xed,0x33,0x01,0xf6,0x7a,0x7f,0x5d,0xa6,0xb0,0x80,0x12,0xb9,0xa4,0xc2,0x39,0xe8,0xbf};
    sm2_fn_from_bytes(a, a73);
    sm2_fn_from_bytes(b, b73);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c73, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a74[32] = {0xe5,0xbb,0xb2,0xfb,0x71,0x64,0x2e,0x53,0x24,0x08,0x83,0x68,0xa8,0x24,0x98,0x24,0xeb,0x2a,0x14,0xf9,0x4c,0x4d,0x4c,0xe7,0xa4,0x9d,0x90,0x48,0x6a,0x74,0x41,0x56};
    static std::uint8_t b74[32] = {0xde,0xd1,0xb0,0xd6,0xab,0xa1,0xcb,0x1a,0x26,0xff,0x79,0x22,0xc8,0xf8,0x3a,0xf4,0xe1,0x47,0x01,0xa8,0xf4,0x72,0x6a,0x5d,0x1e,0xc9,0x99,0x88,0x35,0xd2,0x0f,0x53};
    static std::uint8_t c74[32] = {0x06,0xea,0x02,0x24,0xc5,0xc2,0x63,0x38,0xfd,0x09,0x0a,0x45,0xdf,0x2c,0x5d,0x30,0x09,0xe3,0x13,0x50,0x57,0xda,0xe2,0x8a,0x85,0xd3,0xf6,0xc0,0x34,0xa2,0x32,0x03};
    sm2_fn_from_bytes(a, a74);
    sm2_fn_from_bytes(b, b74);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c74, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a75[32] = {0xa0,0x42,0x58,0xcd,0x86,0xb7,0x7b,0xda,0xc9,0x4e,0xba,0xb0,0xf2,0x92,0xfb,0x5f,0x1c,0x87,0x34,0xda,0x06,0x4a,0x7b,0x27,0x89,0xff,0x51,0xfa,0x1b,0xd5,0x7c,0x31};
    static std::uint8_t b75[32] = {0x37,0xd5,0x57,0xc6,0x5b,0x36,0xc5,0x51,0x3e,0x9d,0xc8,0xb1,0x8f,0x0d,0xfc,0x1d,0x30,0x1a,0xdc,0x0d,0x3a,0x3a,0xc5,0x24,0x95,0x51,0x94,0x54,0xf2,0xf2,0x64,0x43};
    static std::uint8_t c75[32] = {0x68,0x6d,0x01,0x07,0x2b,0x80,0xb6,0x89,0x8a,0xb0,0xf1,0xff,0x63,0x84,0xff,0x41,0xec,0x6c,0x58,0xcc,0xcc,0x0f,0xb6,0x02,0xf4,0xad,0xbd,0xa5,0x28,0xe3,0x17,0xee};
    sm2_fn_from_bytes(a, a75);
    sm2_fn_from_bytes(b, b75);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c75, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a76[32] = {0x79,0x5d,0x1b,0xf6,0x11,0x04,0xf7,0x87,0xc3,0x25,0x53,0xfe,0xaa,0x34,0x8f,0x12,0x18,0x71,0x29,0x3c,0x0e,0x03,0xcd,0xc3,0x40,0x1a,0x8f,0x51,0x85,0x05,0x00,0xf4};
    static std::uint8_t b76[32] = {0x4e,0xc0,0x23,0x4d,0x28,0x3e,0xee,0xdf,0x40,0x8d,0x95,0xbb,0xba,0x7f,0xb4,0x70,0x38,0x80,0x31,0x9b,0x43,0xe0,0xc3,0x05,0x53,0x2f,0x29,0x23,0x78,0xad,0x8e,0x9d};
    static std::uint8_t c76[32] = {0x2a,0x9c,0xf8,0xa8,0xe8,0xc6,0x08,0xa8,0x82,0x97,0xbe,0x42,0xef,0xb4,0xda,0xa1,0xdf,0xf0,0xf7,0xa0,0xca,0x23,0x0a,0xbd,0xec,0xeb,0x66,0x2e,0x0c,0x57,0x72,0x57};
    sm2_fn_from_bytes(a, a76);
    sm2_fn_from_bytes(b, b76);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c76, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a77[32] = {0x5b,0xc7,0x8d,0x5a,0xca,0xc0,0xca,0x27,0xb6,0xc1,0x7a,0x0d,0x49,0x34,0x7e,0x74,0x82,0x78,0xd1,0x1d,0x6a,0x7b,0x21,0x90,0x4e,0x2b,0xb1,0x40,0x01,0xb3,0x81,0x77};
    static std::uint8_t b77[32] = {0xba,0x1b,0x2d,0xdd,0x2f,0x9f,0xd7,0x65,0x2a,0xc2,0xb6,0x21,0x41,0xa4,0x66,0x10,0x26,0x83,0xf7,0x05,0x9c,0x87,0x23,0xfd,0x16,0x3d,0xce,0x53,0x1c,0xd4,0xf8,0x7b};
    static std::uint8_t c77[32] = {0xa1,0xac,0x5f,0x7c,0x9b,0x20,0xf2,0xc2,0x8b,0xfe,0xc3,0xec,0x07,0x90,0x18,0x63,0xcd,0xf8,0xb9,0x82,0xef,0xba,0x02,0xbe,0x8b,0xa9,0xd6,0xf6,0x1e,0xb3,0xca,0x1f};
    sm2_fn_from_bytes(a, a77);
    sm2_fn_from_bytes(b, b77);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c77, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a78[32] = {0x38,0x9c,0xd2,0x68,0xc6,0x4d,0x97,0x65,0x6f,0x88,0x2a,0xe2,0x26,0xe6,0xd2,0xba,0x74,0xb1,0xf7,0xe7,0x98,0x7f,0xda,0xf8,0xdf,0x86,0x63,0x08,0x64,0x40,0x4e,0x02};
    static std::uint8_t b78[32] = {0x52,0xca,0x45,0xf7,0x76,0x24,0xbf,0xe6,0xb3,0x42,0x2f,0x97,0xe6,0xda,0x67,0x65,0x8d,0x2d,0xd3,0x58,0x4c,0x9f,0xf7,0xed,0xc2,0x89,0x7d,0xf4,0xb2,0x57,0x35,0x3d};
    static std::uint8_t c78[32] = {0xe5,0xd2,0x8c,0x70,0x50,0x28,0xd7,0x7e,0xbc,0x45,0xfb,0x4a,0x40,0x0c,0x6b,0x54,0x59,0x88,0x03,0xfa,0x6d,0xa5,0xe8,0x36,0x70,0xb8,0xd9,0x1c,0xeb,0xbe,0x59,0xe8};
    sm2_fn_from_bytes(a, a78);
    sm2_fn_from_bytes(b, b78);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c78, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a79[32] = {0x9f,0x54,0xb2,0x3c,0xe2,0x43,0xfe,0x4d,0x8a,0xa8,0x12,0xbd,0x80,0x7a,0x12,0x22,0xc6,0x69,0xd5,0xdc,0xf0,0x83,0xbb,0x70,0xcf,0x39,0x79,0x8a,0x9a,0x06,0x4f,0x74};
    static std::uint8_t b79[32] = {0xf2,0x0e,0x44,0x4c,0x84,0xdb,0x8f,0x3b,0x2e,0xa1,0x9e,0xaf,0xa7,0x2b,0x69,0x45,0xc4,0x54,0x4a,0x1d,0x11,0x2e,0x82,0xb4,0x0f,0x01,0x2f,0xbf,0xe3,0xfb,0x98,0xc8};
    static std::uint8_t c79[32] = {0xad,0x46,0x6d,0xef,0x5d,0x68,0x6f,0x12,0x5c,0x06,0x74,0x0d,0xd9,0x4e,0xa8,0xdc,0x74,0x19,0x6b,0x2b,0x01,0x1b,0x3d,0xe8,0x13,0xf4,0x3d,0xd3,0xef,0xdf,0xf7,0xcf};
    sm2_fn_from_bytes(a, a79);
    sm2_fn_from_bytes(b, b79);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c79, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a80[32] = {0x6d,0x4a,0x66,0xbb,0xdf,0x40,0x38,0xe3,0x85,0xe7,0x16,0xf0,0xcc,0x7c,0xa2,0xd1,0xba,0xea,0xff,0xb1,0x6b,0xcb,0xbe,0xfa,0x42,0x87,0x84,0xbb,0x79,0xf1,0x49,0x77};
    static std::uint8_t b80[32] = {0xb1,0xce,0xdf,0x33,0x7d,0xcd,0x5c,0xea,0xeb,0xa8,0x52,0xc2,0xd9,0x7e,0xfa,0x63,0xcc,0x7b,0xf9,0x8c,0x3c,0x76,0x9e,0x45,0x0e,0xcb,0xe7,0xf1,0x5e,0xfc,0xa5,0x99};
    static std::uint8_t c80[32] = {0xbb,0x7b,0x87,0x87,0x61,0x72,0xdb,0xf8,0x9a,0x3e,0xc4,0x2d,0xf2,0xfd,0xa8,0x6d,0x60,0x72,0xe5,0x90,0x51,0x1b,0x25,0xe0,0x87,0x77,0x90,0xd3,0x54,0xc9,0xe5,0x01};
    sm2_fn_from_bytes(a, a80);
    sm2_fn_from_bytes(b, b80);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c80, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a81[32] = {0xf9,0xc3,0x57,0x2f,0x8e,0x1e,0x0f,0xbe,0xe0,0x31,0x7f,0x1a,0xe5,0x24,0x00,0x2a,0x55,0x3b,0xd7,0xfe,0x53,0xa8,0x9a,0xf5,0x2d,0xf6,0x78,0x66,0x2b,0x90,0xc7,0xb2};
    static std::uint8_t b81[32] = {0x97,0x24,0x66,0x52,0x59,0x96,0xec,0xd3,0x04,0xa7,0xa8,0xb6,0xcd,0x6e,0x67,0xf2,0x15,0x2f,0x19,0xb2,0xe7,0x3e,0xd8,0x9b,0x63,0xb4,0x07,0xe0,0x4c,0xc5,0x99,0xc8};
    static std::uint8_t c81[32] = {0x62,0x9e,0xf0,0xdd,0x34,0x87,0x22,0xeb,0xdb,0x89,0xd6,0x64,0x17,0xb5,0x98,0x38,0x40,0x0c,0xbe,0x4b,0x6c,0x69,0xc2,0x59,0xca,0x42,0x70,0x85,0xde,0xcb,0x2d,0xea};
    sm2_fn_from_bytes(a, a81);
    sm2_fn_from_bytes(b, b81);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c81, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a82[32] = {0x54,0x07,0x00,0xe1,0x38,0x7c,0x43,0x24,0x0a,0xec,0x90,0x4d,0xd2,0x9d,0xc6,0xc5,0xb7,0xca,0x12,0x1a,0x1b,0xfd,0x36,0x1d,0x67,0xd1,0x17,0xc3,0x70,0x7b,0x00,0x64};
    static std::uint8_t b82[32] = {0xa3,0x70,0x5b,0x1f,0x86,0xfb,0x84,0xab,0xa7,0xbd,0xc9,0x21,0x4a,0xe5,0x64,0x23,0x78,0x0c,0xac,0xe8,0x17,0x94,0x4d,0xed,0x80,0xb4,0xc1,0xf7,0xea,0x6f,0xce,0x3a};
    static std::uint8_t c82[32] = {0xb0,0x96,0xa5,0xc0,0xb1,0x80,0xbe,0x78,0x63,0x2e,0xc7,0x2c,0x87,0xb8,0x62,0xa1,0xb1,0xc1,0x44,0x9d,0x26,0x2e,0xed,0x5b,0x3a,0xd8,0x49,0xd4,0xbf,0xe0,0x73,0x4d};
    sm2_fn_from_bytes(a, a82);
    sm2_fn_from_bytes(b, b82);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c82, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a83[32] = {0x13,0x17,0x58,0xcc,0x7e,0xd9,0xae,0x6a,0xc3,0xc4,0xd9,0xb5,0x44,0x18,0xa0,0xba,0x73,0x9c,0x1f,0x8a,0x4b,0x64,0x7f,0x2a,0x0c,0x87,0x65,0x4b,0x32,0x8d,0xb7,0x6e};
    static std::uint8_t b83[32] = {0x36,0x03,0x79,0xc1,0x6b,0x68,0xf8,0xfd,0x6b,0x88,0xb1,0x5f,0x12,0x4b,0x8d,0x9f,0xb2,0xa3,0x25,0x8d,0x0a,0x70,0x3a,0x88,0x65,0x9c,0x50,0x22,0x00,0x24,0xe9,0x43};
    static std::uint8_t c83[32] = {0xdd,0x13,0xdf,0x0a,0x13,0x70,0xb5,0x6d,0x58,0x3c,0x28,0x56,0x31,0xcd,0x13,0x1a,0x32,0xfc,0xd9,0x68,0x62,0xba,0x49,0xcc,0xfa,0xa7,0x09,0x32,0x6c,0x3e,0x0f,0x4e};
    sm2_fn_from_bytes(a, a83);
    sm2_fn_from_bytes(b, b83);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c83, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a84[32] = {0x7c,0x33,0xcb,0x5b,0x2f,0x2e,0xcc,0x0d,0x8f,0x97,0x19,0xb5,0x53,0x5f,0x2d,0x38,0xbb,0xcc,0x34,0xbd,0x9e,0xe0,0x08,0x65,0x4f,0x38,0x85,0x2f,0x1e,0x6f,0x47,0x1b};
    static std::uint8_t b84[32] = {0x59,0x00,0xc2,0x6d,0xd2,0x2d,0x65,0x30,0x73,0x89,0xe2,0xb7,0xb6,0x28,0xd3,0xa6,0x0a,0x2e,0x9a,0x18,0x6d,0xf7,0x5a,0x9e,0x4d,0xae,0x05,0x0d,0x72,0xb5,0xf4,0x70};
    static std::uint8_t c84[32] = {0x23,0x33,0x08,0xed,0x5d,0x01,0x66,0xdd,0x1c,0x0d,0x36,0xfd,0x9d,0x36,0x59,0x92,0xb1,0x9d,0x9a,0xa5,0x30,0xe8,0xad,0xc7,0x01,0x8a,0x80,0x21,0xab,0xb9,0x52,0xab};
    sm2_fn_from_bytes(a, a84);
    sm2_fn_from_bytes(b, b84);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c84, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a85[32] = {0x77,0x20,0xff,0xe9,0xa7,0x5e,0x08,0x14,0xde,0x79,0x89,0x2c,0xfd,0x18,0x50,0x46,0x85,0xb5,0x06,0xcd,0xa4,0xa0,0x4d,0x7d,0x29,0x7c,0xc5,0xff,0xe4,0x13,0x15,0xb1};
    static std::uint8_t b85[32] = {0x2b,0x58,0x4b,0x1d,0x36,0x39,0x04,0x11,0xda,0x7f,0x1b,0x26,0xd1,0x8f,0x20,0x66,0xa6,0xd5,0x6b,0x7c,0x14,0xaa,0xbf,0xc0,0xb1,0x0a,0xbd,0x3f,0x10,0x28,0xc4,0xc3};
    static std::uint8_t c85[32] = {0x4b,0xc8,0xb4,0xcc,0x71,0x25,0x04,0x03,0x03,0xfa,0x6e,0x06,0x2b,0x89,0x2f,0xdf,0xde,0xdf,0x9b,0x51,0x8f,0xf5,0x8d,0xbc,0x78,0x72,0x08,0xc0,0xd3,0xea,0x50,0xee};
    sm2_fn_from_bytes(a, a85);
    sm2_fn_from_bytes(b, b85);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c85, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a86[32] = {0x70,0xa7,0x52,0x4b,0x64,0xff,0x34,0xfe,0x5e,0xce,0xd1,0x78,0x9a,0xf6,0xd2,0x6c,0xa9,0xf3,0x02,0x86,0xb8,0x22,0xa8,0x4b,0xa2,0xe0,0x35,0xed,0x8e,0x43,0xc9,0x05};
    static std::uint8_t b86[32] = {0x7a,0xdf,0x48,0xc0,0x3c,0xa6,0x08,0x7f,0xe3,0xd0,0xaa,0x6c,0xb1,0x16,0x8a,0x32,0x96,0x61,0x0d,0x83,0x69,0x86,0x30,0xa2,0xdd,0xa9,0xd1,0xbb,0x62,0x30,0x9d,0xf8};
    static std::uint8_t c86[32] = {0xf5,0xc8,0x09,0x8a,0x28,0x59,0x2c,0x7e,0x7a,0xfe,0x27,0x0b,0xe9,0xe0,0x48,0x39,0x85,0x95,0xd4,0x6e,0x70,0x62,0x7c,0xd4,0x18,0xf2,0x58,0x3b,0x65,0xe8,0x6c,0x30};
    sm2_fn_from_bytes(a, a86);
    sm2_fn_from_bytes(b, b86);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c86, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a87[32] = {0x19,0xe3,0x17,0x53,0xf6,0x40,0xf8,0xd3,0xa2,0x53,0x98,0x4b,0x81,0x67,0xb5,0x90,0x7a,0x35,0xf2,0x7f,0x5a,0xdf,0x78,0x95,0x23,0xa7,0x86,0x20,0xa2,0x48,0xee,0x7b};
    static std::uint8_t b87[32] = {0xf4,0x01,0x6c,0x35,0x2a,0x70,0x75,0x8a,0x97,0xd5,0x47,0xe4,0x54,0xde,0x4c,0xff,0x3e,0xb0,0xb3,0x9b,0x29,0xf5,0x9f,0xb3,0xb9,0x1b,0x36,0x02,0x91,0xf8,0x2a,0xbc};
    static std::uint8_t c87[32] = {0x25,0xe1,0xab,0x1d,0xcb,0xd0,0x83,0x49,0x0a,0x7e,0x50,0x67,0x2c,0x89,0x68,0x90,0xad,0x89,0x1e,0x4f,0x52,0xaf,0xde,0x0c,0xbe,0x48,0x44,0x27,0x4a,0x26,0x04,0xe2};
    sm2_fn_from_bytes(a, a87);
    sm2_fn_from_bytes(b, b87);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c87, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a88[32] = {0x93,0x56,0x16,0xe1,0xc8,0xfe,0x14,0x57,0xaa,0x68,0x70,0x50,0xf6,0xa1,0xbc,0x9d,0xf1,0x03,0xf8,0xb9,0xce,0x0a,0x27,0x74,0x36,0x88,0xa3,0x48,0xe8,0xbb,0xe3,0xcc};
    static std::uint8_t b88[32] = {0xf6,0x5d,0xc7,0x37,0x21,0xe1,0x82,0xb0,0xf7,0x94,0x33,0xe9,0x65,0xa0,0x10,0x95,0xa0,0x93,0x56,0x11,0x4d,0x50,0xb4,0x5f,0xc5,0x06,0x1a,0xaf,0xfa,0xe1,0xce,0x14};
    static std::uint8_t c88[32] = {0x9c,0xf8,0x4f,0xa9,0xa7,0x1c,0x91,0xa6,0xb2,0xd4,0x3c,0x67,0x91,0x01,0xac,0x07,0xc2,0x74,0x82,0x13,0xa2,0x7f,0x78,0x3f,0xc5,0x3e,0x7c,0xa2,0x27,0xaf,0x56,0xdb};
    sm2_fn_from_bytes(a, a88);
    sm2_fn_from_bytes(b, b88);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c88, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a89[32] = {0x07,0x4c,0x69,0xe1,0x28,0x51,0xd9,0x91,0x86,0x4f,0xa8,0xa1,0xf3,0x02,0x73,0x7b,0x35,0x81,0x49,0xcd,0x24,0x27,0x80,0x8d,0xd7,0xa1,0xd9,0x0f,0xc4,0xf7,0x15,0x6b};
    static std::uint8_t b89[32] = {0x3b,0x4a,0x39,0x20,0x30,0xf4,0x3e,0xec,0x4e,0xad,0xc5,0x95,0x75,0xaa,0xfe,0x21,0xa9,0x40,0xa8,0x08,0x62,0x86,0xfa,0x0a,0x25,0x3d,0xa3,0xe5,0x1e,0xbd,0x21,0xaf};
    static std::uint8_t c89[32] = {0xcc,0x02,0x30,0xbf,0xf7,0x5d,0x9a,0xa5,0x37,0xa1,0xe3,0x0c,0x7d,0x57,0x75,0x58,0xfe,0x44,0x81,0x2f,0xe3,0x66,0x8b,0xaf,0x06,0x20,0x29,0x33,0xe0,0x0f,0x34,0xdf};
    sm2_fn_from_bytes(a, a89);
    sm2_fn_from_bytes(b, b89);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c89, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a90[32] = {0x1c,0xdd,0xc4,0xcd,0xc6,0xda,0x59,0x17,0x21,0xa6,0xc1,0xf0,0x1e,0xc1,0x64,0x44,0x3e,0x9e,0x85,0x7f,0x0c,0x1c,0xc2,0x9e,0x71,0x5c,0xa6,0x28,0x8b,0x8f,0x7d,0xbf};
    static std::uint8_t b90[32] = {0xef,0x3b,0xf0,0xaa,0xd5,0x0b,0x1a,0xda,0x41,0x0e,0x3d,0x6d,0x32,0x94,0x84,0x83,0xf4,0x7e,0xb8,0x54,0xb4,0xd7,0xff,0x69,0x69,0x04,0x86,0xd7,0xd9,0x9c,0x0c,0x5e};
    static std::uint8_t c90[32] = {0x2d,0xa1,0xd4,0x21,0xf1,0xcf,0x3e,0x3c,0xe0,0x98,0x84,0x82,0xec,0x2c,0xdf,0xbf,0xbc,0x23,0xac,0x95,0x79,0x0a,0xc8,0x60,0x5c,0x14,0x13,0x59,0xeb,0xc8,0xb2,0x84};
    sm2_fn_from_bytes(a, a90);
    sm2_fn_from_bytes(b, b90);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c90, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a91[32] = {0xc2,0x33,0xe3,0x3c,0xdd,0x4d,0x1d,0xcf,0x78,0xaa,0xba,0xa2,0x2a,0x3e,0x84,0x3b,0x3a,0x6c,0x04,0x0a,0x17,0x7e,0x08,0x25,0x93,0x94,0xdd,0x34,0x27,0xb5,0x65,0xb9};
    static std::uint8_t b91[32] = {0x53,0xa1,0x91,0x0d,0x0b,0x82,0x6b,0x9e,0xf2,0x55,0x80,0x98,0x5b,0x6c,0xae,0x75,0xd9,0xe7,0xdb,0x7c,0x54,0x1b,0x02,0x23,0x56,0x6a,0x83,0x0d,0x7f,0x5c,0x49,0x4a};
    static std::uint8_t c91[32] = {0x6e,0x92,0x52,0x2f,0xd1,0xca,0xb2,0x30,0x86,0x55,0x3a,0x09,0xce,0xd1,0xd5,0xc5,0x60,0x84,0x28,0x8d,0xc3,0x63,0x06,0x02,0x3d,0x2a,0x5a,0x26,0xa8,0x59,0x1c,0x6f};
    sm2_fn_from_bytes(a, a91);
    sm2_fn_from_bytes(b, b91);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c91, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a92[32] = {0x00,0x58,0xeb,0xb3,0x40,0x0f,0xda,0x7e,0x88,0x83,0xb4,0xae,0xa9,0x31,0xdb,0x4d,0xb9,0xc1,0xb4,0x94,0x6f,0xeb,0x1e,0xab,0xcd,0x3c,0x9a,0xd2,0xdf,0xa6,0xf7,0x31};
    static std::uint8_t b92[32] = {0xf0,0xfd,0x80,0x86,0xf4,0x86,0x79,0x27,0x71,0xa3,0x59,0xfd,0x5b,0x0f,0x95,0xaa,0xf1,0xb1,0xc2,0xf9,0xfe,0x9e,0x36,0x46,0xca,0x58,0x2e,0x3c,0xa7,0x52,0x64,0xcd};
    static std::uint8_t c92[32] = {0x0f,0x5b,0x6b,0x2b,0x4b,0x89,0x61,0x57,0x16,0xe0,0x5a,0xb1,0x4e,0x22,0x45,0xa2,0x3a,0x13,0xd1,0x05,0x93,0x12,0xed,0x90,0x56,0xa0,0x60,0x9f,0x72,0x29,0xd3,0x87};
    sm2_fn_from_bytes(a, a92);
    sm2_fn_from_bytes(b, b92);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c92, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a93[32] = {0xe8,0x4f,0xfc,0xef,0x4a,0xf9,0x17,0xf8,0xc4,0x41,0x63,0x38,0xc3,0x13,0xda,0xd0,0xd3,0x61,0x95,0x46,0xee,0x9a,0x1e,0xe0,0x9a,0xc0,0x53,0x71,0xc0,0x66,0xf9,0x2d};
    static std::uint8_t b93[32] = {0xcc,0x96,0xf0,0x7f,0x13,0x9b,0x45,0x98,0x66,0x8c,0x73,0x05,0xfa,0xad,0xb1,0x7e,0xf9,0x82,0x56,0x5d,0xb5,0xdc,0xdb,0x0c,0x30,0x0a,0x68,0x3d,0xad,0xbb,0xe9,0x03};
    static std::uint8_t c93[32] = {0x1b,0xb9,0x0c,0x70,0x37,0x5d,0xd2,0x60,0x5d,0xb4,0xf0,0x32,0xc8,0x66,0x29,0x51,0xd9,0xdf,0x3e,0xe9,0x38,0xbd,0x43,0xd4,0x6a,0xb5,0xeb,0x34,0x12,0xab,0x10,0x2a};
    sm2_fn_from_bytes(a, a93);
    sm2_fn_from_bytes(b, b93);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c93, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a94[32] = {0x34,0xf7,0xb9,0x68,0x1b,0x64,0x9b,0x91,0x81,0x91,0xe1,0xa7,0x26,0x31,0x75,0x4e,0x03,0x17,0xd2,0x8d,0x26,0x1e,0xd1,0xba,0xe7,0xa6,0x4c,0x97,0x87,0x39,0xe0,0x92};
    static std::uint8_t b94[32] = {0xbe,0x20,0x62,0x4f,0x96,0xfa,0xca,0x7e,0xd7,0x81,0x28,0x5f,0x40,0x91,0xe1,0x25,0xfa,0x61,0xb8,0x90,0xcd,0x13,0x66,0x39,0xea,0x1c,0xfa,0xd8,0x82,0x56,0x98,0xa1};
    static std::uint8_t c94[32] = {0x76,0xd7,0x57,0x17,0x84,0x69,0xd1,0x12,0xaa,0x10,0xb9,0x47,0xe5,0x9f,0x94,0x27,0x7a,0xb9,0xf9,0x67,0x7a,0xd1,0x70,0xac,0x51,0x45,0x45,0xc8,0x3e,0xb8,0x89,0x14};
    sm2_fn_from_bytes(a, a94);
    sm2_fn_from_bytes(b, b94);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c94, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a95[32] = {0xa2,0x1e,0x9c,0x4b,0x8e,0x05,0x5a,0x4f,0x34,0xc6,0xeb,0xd4,0xa4,0xbb,0x99,0x4c,0x73,0x7f,0xb3,0x07,0x8b,0x7f,0x24,0x0e,0xb4,0x2b,0x50,0x1c,0x3a,0x0a,0xa4,0x7b};
    static std::uint8_t b95[32] = {0x2c,0xb4,0x58,0x45,0x19,0x7d,0xf7,0x9d,0x2c,0x5d,0xfe,0xbc,0x28,0x8b,0xbf,0xc1,0x04,0x9a,0xae,0xe4,0x72,0x0b,0xb6,0xac,0x4f,0x88,0x60,0x8d,0xcb,0x55,0xa3,0xa7};
    static std::uint8_t c95[32] = {0x75,0x6a,0x44,0x06,0x74,0x87,0x62,0xb2,0x08,0x68,0xed,0x18,0x7c,0x2f,0xd9,0x8b,0x6e,0xe5,0x04,0x23,0x19,0x73,0x6d,0x62,0x64,0xa2,0xef,0x8e,0x6e,0xb5,0x00,0xd4};
    sm2_fn_from_bytes(a, a95);
    sm2_fn_from_bytes(b, b95);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c95, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a96[32] = {0x6b,0xe5,0x19,0x74,0xc4,0x18,0x77,0xac,0x1c,0xee,0xbf,0x80,0x6d,0x99,0x61,0xb9,0xef,0xd1,0x1d,0x11,0xf7,0x8b,0xb5,0x14,0x52,0x02,0x3e,0x91,0x5b,0x64,0x93,0xf8};
    static std::uint8_t b96[32] = {0x67,0x43,0xfe,0x41,0x27,0x4e,0x87,0x43,0x1f,0x9f,0x0e,0xf4,0xfd,0xa7,0x75,0xf8,0x83,0x29,0x6b,0x10,0x48,0x02,0x0c,0x47,0x6e,0x4e,0xeb,0x23,0xa2,0x7f,0xd8,0x90};
    static std::uint8_t c96[32] = {0x04,0xa1,0x1b,0x33,0x9c,0xc9,0xf0,0x68,0xfd,0x4f,0xb0,0x8b,0x6f,0xf1,0xeb,0xc1,0x6c,0xa7,0xb2,0x01,0xaf,0x89,0xa8,0xcc,0xe3,0xb3,0x53,0x6d,0xb8,0xe4,0xbb,0x68};
    sm2_fn_from_bytes(a, a96);
    sm2_fn_from_bytes(b, b96);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c96, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a97[32] = {0xe8,0x45,0x1a,0xad,0x90,0x3b,0xfa,0x83,0x17,0x0a,0xeb,0x66,0x15,0x30,0x23,0x78,0x3b,0x82,0xd6,0xfb,0xf1,0xac,0x78,0x95,0x42,0x38,0xc6,0xd9,0x90,0xc2,0x26,0x0c};
    static std::uint8_t b97[32] = {0x79,0x50,0x2f,0x2a,0x6b,0xe9,0xab,0x5c,0x3c,0x5a,0x93,0xb4,0x63,0x31,0x34,0x0d,0x9b,0x9b,0x00,0x5c,0x9b,0xb4,0xda,0x5b,0x2f,0x4e,0xf6,0xfb,0xaf,0x7d,0x8f,0x3c};
    static std::uint8_t c97[32] = {0x6e,0xf4,0xeb,0x83,0x24,0x52,0x4f,0x26,0xda,0xb0,0x57,0xb1,0xb1,0xfe,0xef,0x6a,0x9f,0xe7,0xd6,0x9f,0x55,0xf7,0x9e,0x3a,0x12,0xe9,0xcf,0xdd,0xe1,0x44,0x96,0xd0};
    sm2_fn_from_bytes(a, a97);
    sm2_fn_from_bytes(b, b97);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c97, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a98[32] = {0x7d,0x31,0x99,0x76,0xee,0x2f,0x29,0xb8,0xaf,0xbe,0xa3,0xa0,0x8d,0xee,0x8c,0xeb,0xc4,0x27,0xed,0x36,0x6b,0xbc,0x92,0x80,0x76,0x4f,0xa5,0x76,0x53,0xa9,0x3d,0xdd};
    static std::uint8_t b98[32] = {0xe4,0x22,0x42,0x98,0x14,0xeb,0xb2,0x1b,0x46,0xe9,0xf1,0xdd,0x60,0x62,0x50,0xb4,0x75,0xfd,0xd9,0xf4,0xcf,0x81,0x05,0x5d,0xe3,0x6e,0x9f,0x75,0x7e,0x52,0x50,0xda};
    static std::uint8_t c98[32] = {0x99,0x0f,0x56,0xdd,0xd9,0x43,0x77,0x9d,0x68,0xd4,0xb1,0xc3,0x2d,0x8c,0x3c,0x36,0xc0,0x2d,0xf2,0xac,0xbe,0x01,0x92,0x4d,0xe6,0x9c,0xfa,0x0a,0x0f,0x2c,0x2e,0x26};
    sm2_fn_from_bytes(a, a98);
    sm2_fn_from_bytes(b, b98);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c98, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }

    static std::uint8_t a99[32] = {0xcc,0x28,0xdd,0xd1,0x04,0xc4,0x0b,0xdf,0xee,0xa1,0x9c,0xfb,0xb1,0x32,0x20,0xef,0xd4,0x2d,0x43,0xaf,0x73,0xc2,0x92,0x80,0x1b,0x93,0xbc,0xb6,0xdb,0xbc,0x64,0xcc};
    static std::uint8_t b99[32] = {0x2e,0x4a,0x1d,0x73,0x67,0xba,0x87,0x6b,0x04,0x92,0x74,0xd2,0x0f,0x74,0x2c,0x8d,0x2a,0x6f,0xb1,0x80,0x5b,0xfb,0x0b,0xa7,0xda,0x46,0xe8,0xec,0x72,0xb7,0x1d,0x1e};
    static std::uint8_t c99[32] = {0x9d,0xde,0xc0,0x5d,0x9d,0x09,0x84,0x74,0xea,0x0f,0x28,0x29,0xa1,0xbd,0xf4,0x62,0xa9,0xbd,0x92,0x2f,0x17,0xc7,0x86,0xd8,0x41,0x4c,0xd3,0xca,0x69,0x05,0x47,0xae};
    sm2_fn_from_bytes(a, a99);
    sm2_fn_from_bytes(b, b99);
    sm2_fn_sub(c, a, b);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c99, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sub");
    }
}